e2e: fix navigation + resources playwright specs (admin-bypass becomes unnecessary)#47
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three Playwright failures on master forced every dashboard PR to merge with
gh pr merge --admin. Root causes:navigation.spec.tsasserted 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.fixtures.tsglob did not match the env-query URL. ResourcesPage callslistResources(ctx.env)→/api/v1/resources?env=production, which the bare-glob**/api/v1/resourcesdoesn't match. Replaced with a regex anchored on path + optional query string.<Navigate to="/app/resources/:id">sent the literal string:id.Navigatedoesn'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/:idand/deployments/:idin tiny components that readuseParams()and build the real target. This is a real product bug; the test just happened to catch it. Also dropped the dangling/stacks → /app/stacksredirect (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 passnpm test --run→ 365 pass, 3 skipped (unchanged)🤖 Generated with Claude Code