Wire Playwright e2e into CI and enforce TS coverage thresholds#3
Merged
MelbourneDeveloper merged 9 commits intomainfrom May 1, 2026
Merged
Wire Playwright e2e into CI and enforce TS coverage thresholds#3MelbourneDeveloper merged 9 commits intomainfrom
MelbourneDeveloper merged 9 commits intomainfrom
Conversation
make test runs without the full API stack (only Postgres). Playwright global-setup.ts tries to POST to Clinical/Scheduling APIs on startup, which caused TypeError: fetch failed in CI because the APIs weren't started yet. The dedicated CI step starts APIs then calls make dashboard-ts-e2e directly. Co-Authored-By: Christian Findlay <cftools@nimblesite.co>
- Add make start-stack: starts app + dashboard from docker-compose.yml using a new docker-compose.ci.yml override that sets network_mode:host on the app container so it can reach the already-running Postgres (from make db-migrate) on localhost:5432 - Restore dashboard-ts-e2e in make test (was incorrectly removed) - CI yaml uses only make targets; no inline shell in steps - Playwright install step added before stack startup Co-Authored-By: Christian Findlay <cftools@nimblesite.co>
…e.json override and include - Add support/ to tsconfig.e2e.json include array so support/fixture.ts is included in the e2e TypeScript project - Add ESLint config override for support/**/*.ts and e2e/**/*.ts pointing to tsconfig.e2e.json so parserOptions.project resolves the file correctly
- Add GET /auth/dev-token to Gatekeeper (only active when signing key is 32 zeros) issues a real TokenService.CreateToken JWT for E2E test authentication - Replace broken fake HMAC token generation in jwt.ts with fetchDevToken() that calls Gatekeeper for a properly-issued token; keep synchronous generateTestToken for localStorage-based page auth (used by spec files directly) - Fix api-client.ts and fixture.ts request context to use fetchDevToken (real token) - Fix appointment.spec.ts locator: .first => .first() (was a JS bug not a method call) - Add metric-card class to dashboard KPI cards so tests can find them - Fix quick-actions-legacy CSS: make visible so button tests can interact - Add onCancel handler to EditPatientPage for history.back navigation tests - Fix clinical.ts patient normalization: Active field from API is 0|1 not bool - Fix icd10.ts types: Title/Description optional, add ShortDescription/LongDescription - Format spec files with prettier
…d fix start-services.sh to use ICD-10 health API instead of hardcoded psql hostname
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR
Resurrects the 10 Playwright e2e specs (previously never executed) into
make testand CI, and enforces vitest coverage thresholds on the TypeScript unit-tested modules.Details
What Was Added:
dashboard-ts-e2eMakefile target (pnpm e2evia Playwright) registered in.PHONYmake dashboard-ts-e2eplaywright-report/)Dashboard/dashboard-ts/coverage/**)docker/init-db/init.sh: addsALTER DEFAULT PRIVILEGESso tables created by thepostgressuperuser (viadb-migrate) are accessible to the per-service DB usersMakefile db-migrate:REASSIGN OWNED BY postgres TO $dbpost-migration step for the same reasonWhat Was Changed:
pnpm testnow runsvitest run --coverage(wasvitest run) — coverage is enforced on everymake testrun, not just an opt-in scriptvitest.config.tscoverageincludenarrowed tosrc/auth/**+src/api/client.ts(the modules actually covered by unit tests); enforces thresholds: lines 60%, statements 60%, branches 55%, functions 50%make testnow callsdashboard-ts-e2eafterdashboard-ts-testcoverage-thresholds.jsondocuments where TS thresholds liveWhat Was Deleted:
test:coveragepackage.json script (folded intotest)How Do The Automated Tests Prove It Works?
vitest run --coveragepasses 12 unit tests and reports 71% lines / 72% branches onsrc/auth+src/api/client.ts, clearing the new thresholdscors,navigation,auth,patient,practitioner,appointment,calendar,dashboard,icd10,sync) are now executed against live API processes in CI — previously these specs existed but were never run