Skip to content

Commit d026a8b

Browse files
committed
test(ui): add stale protect-check route regression
1 parent 4aebb88 commit d026a8b

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

packages/ui/src/components/SignUp/__tests__/SignUpProtectCheck.test.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,21 @@ describe('SignUpProtectCheck', () => {
7575
expect(queryByText(/verifying your request/i)).not.toBeInTheDocument();
7676
});
7777

78+
it('routes stale standalone protect-check visits through SignUp routes back to the flow start', async () => {
79+
const { wrapper, fixtures } = await createFixtures(f => {
80+
f.startSignUpWithEmailAddress();
81+
});
82+
fixtures.router.currentPath = '/sign-up/protect-check';
83+
fixtures.router.fullPath = '/sign-up';
84+
fixtures.router.indexPath = '/sign-up';
85+
fixtures.router.matches.mockImplementation((path?: string) => path === 'protect-check');
86+
87+
render(<SignUp />, { wrapper });
88+
89+
await waitFor(() => expect(fixtures.router.navigate).toHaveBeenCalledWith('/sign-up'));
90+
expect(mockExecute).not.toHaveBeenCalled();
91+
});
92+
7893
it('runs the SDK challenge with the URL and resource and submits the proof token', async () => {
7994
const { wrapper, fixtures } = await createFixtures(f => {
8095
f.startSignUpWithProtectCheck({ sdkUrl: 'https://protect.example.com/v1.js' });

0 commit comments

Comments
 (0)