Skip to content

e2e: fix navigation + resources playwright specs (admin-bypass becomes unnecessary)#47

Merged
mastermanas805 merged 1 commit into
mainfrom
fix/playwright-ci-gate-fresh
May 13, 2026
Merged

e2e: fix navigation + resources playwright specs (admin-bypass becomes unnecessary)#47
mastermanas805 merged 1 commit into
mainfrom
fix/playwright-ci-gate-fresh

Conversation

@mastermanas805
Copy link
Copy Markdown
Member

Summary

Three Playwright failures on master forced every dashboard PR to merge with gh pr merge --admin. Root causes:

  1. navigation.spec.ts asserted retired nav links. /Stacks/ link was deleted with the route in b13b8ee (duplicate of Deployments); /Team/ was hidden from the sidebar in the same pass. Test dropped both — tracks the live AppShell sidebar.
  2. fixtures.ts glob did not match the env-query URL. ResourcesPage calls listResources(ctx.env)/api/v1/resources?env=production, which the bare-glob **/api/v1/resources doesn't match. Replaced with a regex anchored on path + optional query string.
  3. <Navigate to="/app/resources/:id"> sent the literal string :id. Navigate doesn't interpolate route params — so every legacy /resources/<token> deep-link redirected to /app/resources/:id (literal), then 404'd into an empty detail-page skeleton. Wrapped /resources/:id and /deployments/:id in tiny components that read useParams() and build the real target. This is a real product bug; the test just happened to catch it. Also dropped the dangling /stacks → /app/stacks redirect (target was deleted with the route).

Once this lands, the playwright CI gate actually works again and future dashboard PRs should not need --admin.

Test plan

  • npx playwright test --project=chromium → 10/10 pass
  • npm test --run → 365 pass, 3 skipped (unchanged)
  • CI runs green on this PR

🤖 Generated with Claude Code

Three failures on master forcing every dashboard PR to merge with
gh pr merge --admin. Root causes:

  1. navigation.spec.ts asserted /Stacks/ and /Team/ sidebar links —
     Stacks retired in b13b8ee (duplicate of Deployments), Team has no
     sidebar entry. Spec dropped to chrome reality.

  2. fixtures.ts mocked GET /api/v1/resources with the glob
     `**/api/v1/resources`, which does not match the env-query variant
     `/api/v1/resources?env=production` that ResourcesPage emits. Glob
     replaced with a regex anchored on path + optional query string.

  3. App.tsx <Navigate to="/app/resources/:id"> sent the literal string
     ":id" instead of the captured route param — Navigate is dumb and
     doesn't interpolate. Wrapped both /resources/:id and
     /deployments/:id in tiny components that read useParams() and
     construct the real target. This is a real product bug (legacy
     deep-links to resource/deploy detail pages 404'd into an empty
     skeleton); the spec just happened to catch it.

Also dropped the dangling `/stacks → /app/stacks` redirect — target was
deleted with the route.

Playwright chromium: 10/10 pass. Vitest unit: 365 pass, 3 skipped
(unchanged).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mastermanas805 mastermanas805 merged commit 4d2eb40 into main May 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant