test(modules): unit, integration & e2e tests for modules CRUD #143

Merged
djalim merged 3 commits from PMPR-113 into develop 2026-04-26 13:34:35 +00:00
Collaborator

Summary

  • Unit tests: mock API (GET/POST/PUT/DELETE, 400/404) and mock DB CRUD for modules
  • Integration tests: real DB round-trips (list, create, get, update, delete, not-found)
  • E2E tests: Fresh handler calls with mock FreshContext (auth checks, 400/403/404)

Test plan

  • deno task test:unit passes
  • deno task test:integration passes (requires postgres)
  • deno task test:e2e passes (requires postgres)

Closes #113

## Summary - Unit tests: mock API (GET/POST/PUT/DELETE, 400/404) and mock DB CRUD for modules - Integration tests: real DB round-trips (list, create, get, update, delete, not-found) - E2E tests: Fresh handler calls with mock FreshContext (auth checks, 400/403/404) ## Test plan - [ ] `deno task test:unit` passes - [ ] `deno task test:integration` passes (requires postgres) - [ ] `deno task test:e2e` passes (requires postgres) Closes #113
djalim force-pushed PMPR-113 from dc18523bd3 to 259311e68c 2026-04-26 13:02:39 +00:00 Compare
djalim force-pushed PMPR-113 from 259311e68c to 7c4aa648e1 2026-04-26 13:05:09 +00:00 Compare
djalim force-pushed PMPR-113 from 7c4aa648e1 to 259311e68c 2026-04-26 13:07:08 +00:00 Compare
djalim force-pushed PMPR-113 from 259311e68c to f1cae9d89e 2026-04-26 13:08:30 +00:00 Compare
djalim added 3 commits 2026-04-26 13:34:29 +00:00
- unit: fixture shapes, mock API (GET/POST/PUT/DELETE + 409), mock DB CRUD
- integration: list, create, get, duplicate rejection, update, delete
- e2e: handler calls with mock context + real DB, covers 400/403/404/409
fix: remove unused assertExists import
Check Deno code / Check Deno code (pull_request) Successful in 5s
Tests / Unit tests (pull_request) Successful in 12s
Tests / Integration tests (pull_request) Successful in 1m1s
Check Deno code / Check Deno code (push) Successful in 5s
Tests / Unit tests (push) Successful in 11s
Tests / Integration tests (push) Successful in 1m10s
e3a7e20993
djalim force-pushed PMPR-113 from f1cae9d89e to e3a7e20993 2026-04-26 13:34:29 +00:00 Compare
djalim merged commit e3a7e20993 into develop 2026-04-26 13:34:35 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: admin/PolyMPR#143