Skip to content

Commit 63b48df

Browse files
aledlieclaude
andcommitted
test(routing): add redirect route verification tests
Add tests to verify top-level routes properly redirect to their dashboard counterparts (e.g., /reports -> /dashboard/reports). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent ae5823e commit 63b48df

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

‎tests/browser/verify-links.spec.ts‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,25 @@ const ROUTES = [
2525
'/dashboard/analytics',
2626
];
2727

28+
// Top-level routes that should redirect to /dashboard/*
29+
const REDIRECT_ROUTES = [
30+
{ from: '/reports', to: '/dashboard/reports' },
31+
{ from: '/quality', to: '/dashboard/quality' },
32+
{ from: '/coverage', to: '/dashboard/coverage' },
33+
{ from: '/tools', to: '/dashboard/tools' },
34+
{ from: '/insights', to: '/dashboard/insights' },
35+
];
36+
37+
test.describe('Top-Level Route Redirects', () => {
38+
for (const { from, to } of REDIRECT_ROUTES) {
39+
test(`${from} redirects to ${to}`, async ({ page }) => {
40+
await page.goto(`${PROD_URL}${from}`);
41+
await page.waitForTimeout(3000);
42+
await expect(page).toHaveURL(new RegExp(to.replace('/', '\\/')));
43+
});
44+
}
45+
});
46+
2847
test.describe('Production Link Verification', () => {
2948
test('root page loads correctly', async ({ page }) => {
3049
await page.goto(PROD_URL);

0 commit comments

Comments
 (0)