test(roles): unit, integration & e2e tests for roles CRUD #142

Merged
djalim merged 2 commits from PMPR-112 into develop 2026-04-26 13:34:17 +00:00
Collaborator

Summary

  • Unit tests: mock API (GET/POST/PUT/DELETE, 400/404) and mock DB CRUD for roles
  • 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 #112

## Summary - Unit tests: mock API (GET/POST/PUT/DELETE, 400/404) and mock DB CRUD for roles - 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 #112
djalim force-pushed PMPR-112 from b0d792f9e9 to 9b021de765 2026-04-26 13:02:39 +00:00 Compare
djalim force-pushed PMPR-112 from 9b021de765 to 0bbd3de265 2026-04-26 13:04:58 +00:00 Compare
djalim force-pushed PMPR-112 from 0bbd3de265 to 9b021de765 2026-04-26 13:07:08 +00:00 Compare
djalim force-pushed PMPR-112 from 9b021de765 to c2579c334d 2026-04-26 13:08:23 +00:00 Compare
djalim added 2 commits 2026-04-26 13:34:11 +00:00
- unit: fixture shapes, mock API (GET/POST/PUT/DELETE), mock DB CRUD
- integration: list, create, assign permissions, update, reset perms, delete
- e2e: handler calls with mock context + real DB, covers 400/404 cases
style: fix deno fmt and lint
Check Deno code / Check Deno code (pull_request) Successful in 6s
Tests / Unit tests (pull_request) Successful in 11s
Tests / Integration tests (pull_request) Successful in 59s
Check Deno code / Check Deno code (push) Successful in 6s
Tests / Unit tests (push) Successful in 11s
Tests / Integration tests (push) Successful in 1m2s
f038e4020b
djalim force-pushed PMPR-112 from c2579c334d to f038e4020b 2026-04-26 13:34:11 +00:00 Compare
djalim merged commit f038e4020b into develop 2026-04-26 13:34:17 +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#142