Skip to content

test: add unit/component tests, E2E, and a11y + Lighthouse CI - #157

Draft
majicmaj wants to merge 1 commit into
donetick:developfrom
majicmaj:testing-infrastructure
Draft

test: add unit/component tests, E2E, and a11y + Lighthouse CI#157
majicmaj wants to merge 1 commit into
donetick:developfrom
majicmaj:testing-infrastructure

Conversation

@majicmaj

Copy link
Copy Markdown

What

Frontend testing from zero — the FE half of a testing initiative (Phases 1–3).

Unit / component (Vitest + RTL + MSW)

  • src/test/ — Vitest setup, MSW server, renderWithProviders helper.
  • DurationUtils / FilterEngine pure-logic tests (the filtering that decides which tasks a user sees).
  • DurationInput component test — RTL + user-event + axe (a11y).

E2E (Playwright)

  • Critical flows: signup and create → complete task, on desktop + mobile, auto-starting the Go backend + Vite dev server (playwright.config.js).

Accessibility (axe-core)

  • e2e/a11y.spec.js scans the critical pages, gating on critical/serious with a known-issue baseline so it catches NEW regressions today and tightens as the shadcn migration lands.
  • Added accessible labels to DurationInput (a real gap the axe test caught).

Lighthouse (advisory)

  • lighthouserc.json + workflow — PWA/a11y/perf signal, all warn, never blocks.

CI

  • Unit tests + build on every push; E2E + Lighthouse on PRs to develop; re-enabled lint as advisory.

Selectors survive the shadcn migration

Everything queries by accessible role/label/text, not MUI Joy DOM.

🤖 Generated with Claude Code

Establishes frontend testing from zero:

- Vitest + React Testing Library + MSW setup (src/test/), plus:
  - DurationUtils / FilterEngine pure-logic unit tests
  - DurationInput component test (RTL + user-event + axe)
- Playwright E2E for the critical flows (signup, create -> complete)
  on desktop + mobile, auto-starting both servers (playwright.config.js)
- axe-core a11y scans of the critical pages with a known-issue baseline
  that catches NEW regressions (e2e/a11y.spec.js)
- Lighthouse CI (advisory, never blocks) for PWA/a11y/perf
- CI: run unit tests on every push; E2E + Lighthouse on PRs to develop;
  re-enabled lint as advisory

Also adds accessible labels to DurationInput (caught by the axe test).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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