Skip to content

chore(test): run unit tests with vitest and add playwright e2e tests - #75

Open
brandyscarney wants to merge 3 commits into
chore/fix-lint-warningsfrom
chore/add-test-infrastructure
Open

brandyscarney wants to merge 3 commits into
chore/fix-lint-warningsfrom
chore/add-test-infrastructure

Conversation

@brandyscarney

@brandyscarney brandyscarney commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

What This Does

Replaces Cypress with Playwright for end-to-end tests, aligns the Vitest unit test setup with the other apps, and runs both in CI.

New Behavior

  • npm run test:unit runs the unit tests once (Vitest). npm run test:unit:watch reruns them on changes.
  • npm run test:e2e runs the Playwright tests in Mobile Chrome (Pixel 7). It starts the dev server on port 4313, a port reserved for this app's e2e tests so it never reuses another app's server. The first time, install the browser with npx playwright install chromium.
  • npm test runs both.
  • Every pull request also runs an E2E job on Linux, which uploads the Playwright HTML report.

Changes

  • Playwright config and a smoke spec in e2e/: the first tab loads, and the tab bar opens the photo gallery.
  • Replaces Cypress with Playwright; the smoke spec ports the Cypress check (the first tab loads) and adds tab navigation.
  • Test dependencies match the conference React app: Vitest 4 → 5, jsdom 22 → 30, and jest-dom 5 → 6 (via @testing-library/jest-dom/vitest). The unused @testing-library/user-event is removed.
  • Tests import from vitest instead of relying on globals, and the setup calls Testing Library's cleanup() after each test (it only does that automatically with globals). The matchMedia stub implements the full API.
  • Vitest only collects tests from src/.
  • Renames test.unit / test.e2e to test:unit / test:e2e.
  • ESLint ignores Playwright's output folders.
  • CI: the Test job runs npm run test:unit, and the new E2E job runs npm run test:e2e.
  • renovate.json: the testing group covers Vitest, jsdom, and Playwright.
  • A Testing section in the README.

Notes

  • This PR sets up the test tooling with smoke tests; tests for the photo gallery itself come in the next PR.

@brandyscarney
brandyscarney added this pull request to stack #74 October 23, 2026 17:08
@brandyscarney
brandyscarney requested a review from a team as a code owner October 23, 2026 17:08
@brandyscarney
brandyscarney requested review from ShaneK and removed request for a team October 23, 2026 17:08
@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
tutorial-photo-gallery-react Ready Ready Preview Oct 23, 2026 7:16pm UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview — 87cf7068 Deployed Oct 23, 2026 by vercel[bot]
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