Commit abdf8fb
fix(e2e): make Playwright tests pass — route prefix + test routing (#22)
Two related fixes that turn the failing CI green for the first time
since /app/* routing was introduced in PR #14:
1. src/layout/AppShell.tsx — routeIdToKey() now strips the /app
prefix before looking up PAGE_META. Before this change, every
authenticated page rendered an empty <h1> (the meta.title lookup
missed because the keys are short, e.g. '/resources', but the
actual pathname after PR #14 is '/app/resources'). The empty h1
was visible in the trace from
github.com/InstaNode-dev/instanode-web/actions/runs/25675342041
— heading[level=1] had no text content even though the rest of
the page rendered correctly.
2. e2e/auth.spec.ts + e2e/navigation.spec.ts — updated the tests
to navigate to /app instead of / for authenticated routes. The
old tests assumed the dashboard lived at /, but that's the
public marketing page now. Updated 4 test cases:
- "unauthenticated user redirected to /login": go to /app
- "login accepts valid token, lands on overview": expect
/app on success
- "signed-in user lands on overview directly": go to /app,
expect Overview h1
- "every nav link reaches its page": all targets get the
/app prefix, plus go to /app instead of / first
- "OAuth buttons": dropped Google assertion (UI exposes
GitHub + magic-link only today; Google OAuth route exists
on the backend but no UI button has been added yet)
Result locally: 10/10 Playwright tests pass. The CI failure that
started on PR #11 (slice B, the first PR after /app/* routing
landed) is gone.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent dd4d67f commit abdf8fb
3 files changed
Lines changed: 37 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
5 | 8 | | |
6 | | - | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
| |||
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
34 | | - | |
| 37 | + | |
| 38 | + | |
35 | 39 | | |
36 | 40 | | |
37 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
38 | 46 | | |
39 | 47 | | |
40 | | - | |
41 | 48 | | |
42 | 49 | | |
43 | 50 | | |
44 | 51 | | |
45 | 52 | | |
46 | | - | |
47 | | - | |
48 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
49 | 57 | | |
50 | 58 | | |
51 | 59 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
287 | | - | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
288 | 295 | | |
| 296 | + | |
289 | 297 | | |
290 | | - | |
291 | | - | |
292 | | - | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
293 | 301 | | |
294 | 302 | | |
295 | 303 | | |
| |||
0 commit comments