Skip to content

Commit

Permalink
fixup! Rename settingUp to onSetupTour
Browse files Browse the repository at this point in the history
  • Loading branch information
canac committed Sep 5, 2024
1 parent cac4766 commit bc40ac1
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const push = jest.fn();

const router = {
query: { accountListId },
pathname: '/accountLists/[accountListId]/settings/integrations',
isReady: true,
push,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const push = jest.fn();

const router = {
query: { accountListId },
pathname: '/accountLists/[accountListId]/settings/notifications',
isReady: true,
push,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const push = jest.fn();

const router = {
query: { accountListId },
pathname: '/accountLists/[accountListId]/settings/preferences',
isReady: true,
push,
};
Expand Down
21 changes: 18 additions & 3 deletions src/components/Setup/SetupProvider.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,12 @@ describe('SetupProvider', () => {
expect(getByTestId('setting-up')).toHaveTextContent('undefined');
});

it('is true when setup is set', async () => {
it('is true when setup is set on a tour page', async () => {
const { getByTestId } = render(
<TestComponent
setup={UserSetupStageEnum.NoDefaultAccountList}
setupPosition=""
pathname="/setup/start"
/>,
);

Expand All @@ -120,16 +121,30 @@ describe('SetupProvider', () => {
);
});

it('is true when setup_position is set', async () => {
it('is true when setup_position is set on a tour page', async () => {
const { getByTestId } = render(
<TestComponent setup={null} setupPosition="start" />,
<TestComponent
setup={null}
setupPosition="start"
pathname="/setup/start"
/>,
);

await waitFor(() =>
expect(getByTestId('setting-up')).toHaveTextContent('true'),
);
});

it('is true when not on a tour page', async () => {
const { getByTestId } = render(
<TestComponent setup={null} setupPosition="start" />,
);

await waitFor(() =>
expect(getByTestId('setting-up')).toHaveTextContent('false'),
);
});

it('is false when setup_position is not set', async () => {
const { getByTestId } = render(
<TestComponent setup={null} setupPosition="" />,
Expand Down

0 comments on commit bc40ac1

Please sign in to comment.