Skip to content

test(web): cut e2e specs already proved by integration tests - #228

Merged
madangryscientist merged 1 commit into
mainfrom
test-web-cut-e2e-specs-already-proved-by
Nov 13, 2026
Merged

madangryscientist merged 1 commit into
mainfrom
test-web-cut-e2e-specs-already-proved-by

Conversation

@madangryscientist

Copy link
Copy Markdown
Owner

Problem

The web e2e suite ran 68 tests in 34 spec files. Many of them checked data and logic (a count, a sentence, a rule) through a real browser, slowly, when a render or integration test proves the same thing in milliseconds. docs/testing.md says a behaviour is proved at the lowest layer that can prove it.

Change

Eight specs are deleted whole, and three tests are cut from two others. The suite goes from 68 tests in 34 files to 51 in 26 (bunx playwright test --list in apps/web, before and after).

  • Every deleted assertion is proved by a named lower test (table below), or is looks only (theme, phone width).
  • Where a browser was the only proof of page wiring, there is now a render test. src/test/render-routed.tsx renders a component that carries a <Link> inside a memory-history router; src/test/snapshot-view.ts and src/test/by-test-id.ts are shared fixtures.
  • A few pure pieces moved out of server or component files so a test can import them without the Worker runtime. They are moved as written, not changed: walkAround (the j/k order, now lib/review-walk.ts), the summary counts line (lib/summary-counts.ts), findingsLine (now in composition.tsx), and toReviewText is exported.
  • The e2e helper options nothing uses any more are removed (composition, meta and metrics on a shot, the finalise body, the stub's brief answer). No helper file became an orphan: each is still imported by a kept spec.
  • orgs.spec.ts gained one step (the org Timings tab: link, ?tab=timings URL, empty state), because the deleted timings.spec.ts was the only walk of that wiring.
  • admin-health-now.test.ts is merged into admin-health.test.ts (its fixtures moved to admin-health-kit.ts to stay under the 300-line lint cap).
  • docs/testing.md states the new count and lists this cut with what covers each spec.

Not done, and kept on purpose

  • ai/summary-parse.test.ts is not merged into summary.test.ts. summary.test.ts already sits at the 300 code-line max-lines cap, so the merge fails lint, and lint rules are not disabled here.
  • Kept e2e: "an opted-in project's model auto-passes a noise-only shot and says why" and "a project without its own model uses the org's, and its own overrides it" (ai-review.spec.ts), and "the project settings link a twin project of the same org, and clear it" (twins.spec.ts). They need the hydrated settings forms, their server functions and the stub model pipeline together; no render test reaches that.
  • Residual gap, not closed: the route files mount <BuildBrief> on the build and branch pages in one line each. The component, its words and the data it reads are tested; that the route mounts it is not, short of a browser.

Deleted e2e tests and what covers them

Deleted e2e test Covered by
composition.spec.ts "one gap and one special case are listed and drawn on the branch shot" components/composition.test.tsx (overlay, row, toggle and legend, focus), components/shot-card.test.tsx (the card's findings line), api/composition.test.ts
composition.spec.ts "a new shot, which nothing measured, still has its boxes, placed on the image's own size" components/composition.test.tsx, api/composition.test.ts
carried-from-main.spec.ts "a build held open by differences from main shows them as changed and new" diff/process-open-vs-main.test.ts, diff/process-open-vs-main-page.test.ts, lib/summary-counts.test.ts, lib/review-walk.test.ts
metrics.spec.ts "a diffed build states its wall time, counts and compare time, and the branch its window" components/run-metrics.test.tsx (build card, shot page, branch page), lib/run-card.test.ts, lib/run-metrics.test.ts, lib/branch-metrics.test.ts
brief.spec.ts "a brief is shown as text, and the summary reads the build against it" components/build-brief.test.tsx, components/brief-summary.test.tsx, api/brief.test.ts, ai/summary-brief.test.ts
native.spec.ts "an android import uploads and diffs against its own baseline; web is untouched; a new device is a re-baseline" diff/process-native.test.ts, components/snapshot-side-panel.test.tsx, api/native.test.ts, packages/cli/test/import-native.test.ts
parity.spec.ts "the side panel opens the parity view: web and android side by side, no ios twin, a metrics sentence" components/parity-view.test.tsx, components/twins.test.tsx, api/parity.test.ts
parity.spec.ts "all three platforms side by side, and an unlinked shot opens the view" components/parity-view.test.tsx, api/parity.test.ts, api/twins.test.ts
parity.spec.ts "a web-only project has no Compare platforms link" components/parity-view.test.tsx, components/twins.test.tsx
stale.spec.ts "accepting a web change makes the android twin stale until an android shot is accepted" components/stale.test.tsx, db/stale.test.ts, db/stale-review.test.ts, api/stale.test.ts, diff/process-stale.test.ts; accepting is walked by the kept review.spec.ts
timings.spec.ts "a diffed build shows its server timings, and the org's Timings tab their p50 and max" components/build-timings.test.tsx, components/org-timings.test.tsx, db/timings-stats.test.ts; the tab click is the new step in orgs.spec.ts
timings.spec.ts "a build shows the CLI's full speed profile in both themes, at desktop and phone width" components/build-timings.test.tsx (the profile); the themes and phone width are looks only
timings.spec.ts "a build from an older CLI shows its steps and no profile" components/build-timings.test.tsx, lib/timings.test.ts
timings.spec.ts "with no build the Timings tab says so, not a row of dashes" components/org-timings.test.tsx; the tab wiring is the new orgs.spec.ts step
ai-review.spec.ts "a build with 10 changed shots gets no summary, says why, and offers no Regenerate" components/build-summary.test.tsx (the 9 and 10 changed-shot boundary)
ai-review.spec.ts "with no model a changed shot is reviewed as plain pixels" components/ai-notes.test.tsx, diff/process.test.ts
twins.spec.ts "a web and an android shot of one name and theme are twins; an android-only one is unlinked" components/twins.test.tsx, db/twins.test.ts, api/twins.test.ts

How it was tested

From the worktree: bun install, bun run typecheck, bun run lint (includes check-dashes), bun run format:check and bunx nx test web --skip-nx-cache all pass. No browser was used; bunx playwright test --list gave the counts. The one new e2e step (orgs.spec.ts) runs in the CI web job.

Eight web e2e specs, and four tests in two others, checked data and
logic through a browser: composition, carried from main, run metrics,
timings, the brief, native shots, parity, stale shots, the AI summary
limit and the twin banner. Each assertion is now proved by a unit or
integration test, or is looks only (theme, phone width). The e2e suite
goes from 34 spec files and 69 tests to 26 and 51.

Where a browser used to prove the page wiring, a render test does: a
small memory-history router helper (src/test/render-routed.tsx) renders
components that carry a link. To make pure pieces importable without
the Worker runtime, walkAround (the j/k order), the summary counts line,
findingsLine and toReviewText moved out of their server or component
files unchanged.

Two e2e tests in ai-review.spec.ts and the project settings test in
twins.spec.ts stay: they need the settings forms, server functions and
the stub model pipeline together.

admin-health-now.test.ts is merged into admin-health.test.ts, with its
fixtures in admin-health-kit.ts to keep the file under the line cap.
summary-parse.test.ts stays separate: summary.test.ts is at the cap.
@madangryscientist
madangryscientist merged commit 4fc6b19 into main Nov 13, 2026
7 checks passed
@madangryscientist
madangryscientist deleted the test-web-cut-e2e-specs-already-proved-by branch November 13, 2026 23:54
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