}
interface OwnProps {
+ location: { pathname: string };
children?: React.ReactNode;
}
};
tryAutoOpenOnboarding = () => {
- if (this.props.currentUser.showOnboardingTutorial) {
+ const { currentUser, location } = this.props;
+ if (currentUser.showOnboardingTutorial && !location.pathname.startsWith('documentation')) {
this.setState({ automatic: true });
this.openOnboarding();
}
(get as jest.Mock<any>).mockReturnValueOnce('date');
(differenceInDays as jest.Mock<any>).mockReturnValueOnce(0);
await shouldNotHaveModals(getWrapper());
+
+ await shouldNotHaveModals(
+ getWrapper({
+ canAdmin: false,
+ currentUser: { ...LOGGED_IN_USER, showOnboardingTutorial: true },
+ location: { pathname: 'documentation/index' }
+ })
+ );
});
it('should render license prompt', async () => {
canAdmin={true}
currentEdition={EditionKey.enterprise}
currentUser={LOGGED_IN_USER}
+ location={{ pathname: 'foo/bar' }}
skipOnboarding={jest.fn()}
{...props}>
<div />