test: add MVP QA gate

This commit is contained in:
vince 2026-06-18 19:41:29 +02:00
parent af09f705b1
commit 081d6085a5
10 changed files with 413 additions and 7 deletions

View file

@ -21,6 +21,9 @@ This MVP uses Drizzle with Bun SQLite for local file-backed persistence.
- `bun run dev`: start the local development server.
- `bun run check`: run Svelte and TypeScript checks.
- `bun run test`: run Vitest.
- `bun run test:unit`: run Vitest explicitly as the unit test stage.
- `bun run test:e2e`: run Playwright browser smoke and QA checks.
- `bun run test:qa`: run the MVP release gate.
- `bun run build`: build the production app.
- `bun run preview`: preview the production build.
- `bun run storybook`: start the component explorer on port 6006.
@ -69,3 +72,43 @@ seed data expansion and rendering pipeline.
Storybook covers the reusable UI components with generic fixtures only. Stories
must not import environment-specific dashboard content; the presentation layer
accepts labels, values, icons, status, and links through typed props.
## MVP QA Gate
Install the Chromium browser once before running e2e checks locally:
```sh
bunx playwright install chromium
```
Run the CI-ready release gate with:
```sh
bun run test:qa
```
The gate runs Svelte/TypeScript checks, Vitest coverage for model,
persistence, renderer, datasource mocks, and presentation boundaries, the
production build, the static Storybook build, and Playwright desktop/mobile
smoke checks. Playwright also performs basic screenshot sanity checks,
keyboard-focus checks, reduced-motion checks, landmark checks, and axe
accessibility checks against the real model-driven route.
Presentation code is checked for Dimension Lab content leakage. Environment
specific labels, links, icon names, fallback values, and datasource references
belong in validated model data, not reusable components.
## Deployment Notes
The production build uses the SvelteKit Node adapter, but the current SQLite
driver depends on Bun. A minimal deployment flow is:
```sh
bun install --frozen-lockfile
bun run build
DATABASE_URL=file:/data/dimensionlab.sqlite HOST=0.0.0.0 PORT=3000 bun build/index.js
```
Mount `/data` or set `DATABASE_URL` to another persistent SQLite path. If the
process starts outside the repository root, set `DASHBOARD_MIGRATIONS_DIR` to
the checked-in `drizzle/` directory so startup migrations can run.