Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,21 @@
expect(queryByText(/verifying your request/i)).not.toBeInTheDocument();
});

it('routes stale standalone protect-check visits through SignUp routes back to the flow start', async () => {

Check failure on line 78 in packages/ui/src/components/SignUp/__tests__/SignUpProtectCheck.test.tsx

View workflow job for this annotation

GitHub Actions / Unit Tests (**)

src/components/SignUp/__tests__/SignUpProtectCheck.test.tsx > SignUpProtectCheck > routes stale standalone protect-check visits through SignUp routes back to the flow start

Error: Test timed out in 5000ms. If this is a long-running test, pass a timeout value as the last argument or configure it globally with "testTimeout". ❯ src/components/SignUp/__tests__/SignUpProtectCheck.test.tsx:78:3

Check failure on line 78 in packages/ui/src/components/SignUp/__tests__/SignUpProtectCheck.test.tsx

View workflow job for this annotation

GitHub Actions / Unit Tests (**)

src/components/SignUp/__tests__/SignUpProtectCheck.test.tsx > SignUpProtectCheck > routes stale standalone protect-check visits through SignUp routes back to the flow start

Error: Test timed out in 5000ms. If this is a long-running test, pass a timeout value as the last argument or configure it globally with "testTimeout". ❯ src/components/SignUp/__tests__/SignUpProtectCheck.test.tsx:78:3
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(<SignUp />, { wrapper });

await waitFor(() => expect(fixtures.router.navigate).toHaveBeenCalledWith('/sign-up'));
expect(mockExecute).not.toHaveBeenCalled();
});
Comment on lines +78 to +91

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Mark this as an expected-to-fail regression test.

Per the PR objectives, this test is intentionally documenting a currently-broken behavior (navigateToFlowStart no-ops when routed through the real SignUp/Route path="protect-check" because indexPath equals the relative currentPath). As written, this is a plain it(...) block, so it will fail in CI once merged. Use Vitest's it.fails (or skip with a tracking-issue comment) so the suite doesn't break until the underlying fix lands.

🔧 Proposed fix
-  it('routes stale standalone protect-check visits through SignUp routes back to the flow start', async () => {
+  // TODO(`#XXXX`): navigateToFlowStart currently no-ops for routed protect-check visits.
+  it.fails('routes stale standalone protect-check visits through SignUp routes back to the flow start', async () => {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
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(<SignUp />, { wrapper });
await waitFor(() => expect(fixtures.router.navigate).toHaveBeenCalledWith('/sign-up'));
expect(mockExecute).not.toHaveBeenCalled();
});
// TODO(`#XXXX`): navigateToFlowStart currently no-ops for routed protect-check visits.
it.fails('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(<SignUp />, { wrapper });
await waitFor(() => expect(fixtures.router.navigate).toHaveBeenCalledWith('/sign-up'));
expect(mockExecute).not.toHaveBeenCalled();
});
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/ui/src/components/SignUp/__tests__/SignUpProtectCheck.test.tsx`
around lines 78 - 91, This test is documenting a known broken flow, so it should
be marked as expected-to-fail rather than a normal passing test. Update the
SignUpProtectCheck test case in SignUpProtectCheck.test.tsx from a plain it(...)
to Vitest’s it.fails(...) (or another explicit expected-failure mechanism) so
the suite does not fail in CI while navigateToFlowStart and the protect-check
route behavior remain unfixed.


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' });
Expand Down
Loading