From d026a8bebcbdbf6c607da32f717cf30989a58327 Mon Sep 17 00:00:00 2001 From: Alex Carpenter Date: Mon, 6 Jul 2026 16:52:36 -0400 Subject: [PATCH] test(ui): add stale protect-check route regression --- .../SignUp/__tests__/SignUpProtectCheck.test.tsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/ui/src/components/SignUp/__tests__/SignUpProtectCheck.test.tsx b/packages/ui/src/components/SignUp/__tests__/SignUpProtectCheck.test.tsx index a32a29b717d..29c39d50366 100644 --- a/packages/ui/src/components/SignUp/__tests__/SignUpProtectCheck.test.tsx +++ b/packages/ui/src/components/SignUp/__tests__/SignUpProtectCheck.test.tsx @@ -75,6 +75,21 @@ describe('SignUpProtectCheck', () => { expect(queryByText(/verifying your request/i)).not.toBeInTheDocument(); }); + it('routes stale standalone protect-check visits through SignUp routes back to the flow start', async () => { + const { wrapper, fixtures } = await createFixtures(f => { + f.startSignUpWithEmailAddress(); + }); + fixtures.router.currentPath = '/sign-up/protect-check'; + fixtures.router.fullPath = '/sign-up'; + fixtures.router.indexPath = '/sign-up'; + fixtures.router.matches.mockImplementation((path?: string) => path === 'protect-check'); + + render(, { wrapper }); + + await waitFor(() => expect(fixtures.router.navigate).toHaveBeenCalledWith('/sign-up')); + expect(mockExecute).not.toHaveBeenCalled(); + }); + it('runs the SDK challenge with the URL and resource and submits the proof token', async () => { const { wrapper, fixtures } = await createFixtures(f => { f.startSignUpWithProtectCheck({ sdkUrl: 'https://protect.example.com/v1.js' });