Skip to content

test(e2e): cover every area, and fix the overflow this found - #267

Merged
diese-tech merged 2 commits into
mainfrom
claude/e2e-coverage-every-area
Sep 1, 2026
Merged

test(e2e): cover every area, and fix the overflow this found#267
diese-tech merged 2 commits into
mainfrom
claude/e2e-coverage-every-area

Conversation

@diese-tech

@diese-tech diese-tech commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Problem

The end-to-end suite reached 29 of the app's 38 routes. The match report flow had no coverage at all — which is how its review screen shipped with two independently side-scrolling stat tables and 40px inputs (#266).

Uncovered before this change: /admin/match-report, /admin/audit, /admin/teams, /admin/seasons/[id]/roster, /announcements/[id], /auth/error, /draft/god/[sessionId], /match-reports/[id]/review, /report-a-bug/tickets/[publicTicketId], /scouters/[matchId].

Coverage added

tests/e2e/match-report.spec.ts — the area that had none. Authorization, the selection step, division grouping, search filtering, honest failure when the report cannot be created, and no console errors.

It also drives the client into the review step, where the stat editors actually render. Creating a report is the only Supabase write on that path, so it is stubbed; everything after — clicking a match, then Skip → Manual Entry, building the blank roster rows from the mock league data the server already serves — is real client code. That makes four assertions real rather than nominal:

  • both team editors render, with ten roster rows, two winner controls and the submit action;
  • stat inputs are ≥32px tall and ≥36px wide, guarding the 0.75rem micro-inputs directly;
  • nothing under <main> scrolls sideways, at 390 / 768 / 1440 / 1920;
  • adding a game keeps the layout intact.

tests/e2e/uncovered-routes.spec.ts — the rest. The token-bound host review and private ticket pages rendering their shell for an unknown id (rather than 500-ing), the auth error page, the god draft session page, 404s for unknown announcement and scouter ids, and every admin area that had no rendering or overflow coverage.

tests/e2e/site.spec.ts — the logged-out redirect now covers all fourteen admin routes rather than seven, and every nav item is opened.

Two real bugs the new tests caught

Both horizontal overflow at 390px, the same class of bug as #266:

Page Cause Fix
/admin/seasons shrink-0 on the wrapping per-season button group stopped it shrinking below its max-content width — a 658px group on a 390px viewport drop shrink-0; the group already wraps internally
/admin/registrations the filter row never wrapped, so its tabs plus the trailing count pushed 78px past the viewport flex-wrap items-center

/admin/audit also failed initially, but that was my own wrong assertion — its heading is "Pending Deletions"; "Audit Log" is only the nav label.

Verification

  • 397 e2e tests pass, up from 343, green in CI on the repo's own Playwright config.
  • I confirmed the overflow guard actually bites by reintroducing the regression (min-w-[900px] rows inside an overflow-x-auto container): 3 of the 4 viewports fail, and 1920 passes because 900px genuinely fits there. Reverted before pushing.
  • npx tsc --noEmit clean; npm run lint reports no new warnings; npm run test — 781 passed, 26 skipped, 0 failed.

An incidental find while writing the locators: an <input> bound to a <datalist> reports role combobox, not textbox.

The end-to-end suite reached 29 of the app's 38 routes. The match report
flow had no coverage at all, which is how its review screen shipped with
two independently side-scrolling stat tables and 40px inputs.

Coverage:
- match-report.spec.ts covers the area that had none: authorization, the
  selection step, division grouping, search filtering, honest failure when
  the report cannot be created, no console errors, and no horizontal
  overflow at 390/768/1440/1920. One assertion walks every element under
  <main> and fails if any scrolls sideways -- the direct regression guard
  for the review layout.
- uncovered-routes.spec.ts covers the rest: the token-bound host review and
  private ticket pages rendering their shell for an unknown id, the auth
  error page, the god draft session page, 404s for unknown announcement and
  scouter ids, and every admin area that had no rendering or overflow
  coverage.
- site.spec.ts now asserts the logged-out redirect for all fourteen admin
  routes rather than seven, and opens every nav item.

Two real bugs the new tests caught, both horizontal overflow at 390px:
- Admin seasons: `shrink-0` on the wrapping per-season button group stopped
  it shrinking below its max-content width, so a 658px group ran off a
  390px viewport. It wraps internally, so it does not need shrink-0.
- Admin registrations: the filter row never wrapped, so its tabs plus the
  trailing count pushed 78px past the viewport.

391 e2e tests pass, up from 343. Typecheck clean, no new lint warnings,
781 unit tests pass.
@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sal-draft-league Ready Ready Preview Sep 1, 2026 1:54pm UTC

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7fbd72a53a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/e2e/match-report.spec.ts Outdated
The overflow scan only loaded the selection step. The stat editors render
in the review step, so a regression restoring the independently scrolling
tables would have passed the very test named after it — the assertion
promised more than it checked.

Creating a report is the one Supabase write on the path, so it is stubbed
and the rest is real client code: clicking a match, then Skip to Manual
Entry, builds the blank roster rows from the mock league data the server
already serves and lands in the review step.

That makes four assertions real rather than nominal:
- both team editors render, ten roster rows with their stat fields, two
  winner controls and the submit action;
- stat inputs are ≥32px tall and ≥36px wide, guarding the 0.75rem
  micro-inputs directly;
- nothing under <main> scrolls sideways, at 390/768/1440/1920;
- adding a game keeps the layout intact.

Proved the guard works by reintroducing the regression (min-w-[900px] rows
inside an overflow-x-auto container): three of the four viewports fail, and
1920 passes because 900px genuinely fits there. Restored, 397 e2e tests
pass.

An input bound to a datalist reports role combobox rather than textbox, so
the row locators match on the accessible label instead.
@diese-tech
diese-tech merged commit 786f8bc into main Sep 1, 2026
17 checks passed
@diese-tech
diese-tech deleted the claude/e2e-coverage-every-area branch September 1, 2026 14:11
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