Browser-only demo — E2E follow-up
Unit + component tests for the demo adapter, seed, and banner ship in
frontend/src/api/demo/__tests__/ (33 tests). What was not added
in the same task is Playwright e2e coverage: setting up
@playwright/test, browsers, and CI wiring is a fresh infrastructure
step separate from the demo adapter itself.
What the smoke should exercise
Given a Playwright install and a running VITE_DEMO=1 npm run preview
on port 4173, the smoke script should:
- Land on
/— expect the demo banner ("Démo — vos actions sont…") and the Dashboard to render two accounts with computed balances. - Click the Transactions nav item — expect a paginated table with at least the seed's ~180 rows and the running-balance column populated when an account filter is active.
- Inline-edit one transaction's category, refresh the page, expect the new category to survive (localStorage persistence).
- Click Reset the demo in the banner — expect the toast "Démo réinitialisée." and the edit to be gone.
- Attempt to open the PDF imports flow — expect the
DemoUnavailableModal(or the French demoStub message) instead of a raw stack trace. - Load the DevTools Network tab and confirm no request goes to
/api/*beyond static assets.
Setup outline
cd frontend
npm install --save-dev @playwright/test
npx playwright install --with-deps chromium
mkdir -p e2e
# author e2e/demo.spec.ts against the outline above
CI: extend .github/workflows/docs.yml (or a separate demo-e2e.yml)
with a step that runs npm run preview in the background, waits for
port 4173, then runs npx playwright test.
Manual verification checklist
-
VITE_DEMO=1 npm run build:demo && npx serve dist-demoopens the app locally without network calls to/api/*. - Every top-level nav (Dashboard, Transactions, Budgets, Rules children, Accounts children, Data children, Settings, Profile) renders without a raw error.
- Reset button flushes local edits.