test(users): integration & e2e tests for users CRUD #141

Closed
djalim wants to merge 3 commits from PMPR-111 into develop
Collaborator

Summary

  • Unit tests: mock API (GET/POST/PUT/DELETE, 400/404) for users
  • Integration tests: real DB round-trips (list, create, get by id)
  • 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 #111

## Summary - Unit tests: mock API (GET/POST/PUT/DELETE, 400/404) for users - Integration tests: real DB round-trips (list, create, get by id) - 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 #111
djalim force-pushed PMPR-111 from 4eb575379b to 33a1ec9666 2026-04-26 13:02:39 +00:00 Compare
djalim force-pushed PMPR-111 from 33a1ec9666 to 3ac514a33d 2026-04-26 13:04:45 +00:00 Compare
djalim force-pushed PMPR-111 from 3ac514a33d to 33a1ec9666 2026-04-26 13:07:08 +00:00 Compare
djalim force-pushed PMPR-111 from 33a1ec9666 to c8bf05841b 2026-04-26 13:08:14 +00:00 Compare
djalim added 3 commits 2026-04-26 13:33:51 +00:00
- integration: list, filter by role, create, get, update, delete, not-found
- e2e: handler calls with mock context + real DB, covers 400/409/404 cases
  (unit tests already present from teammates)
style: fix deno fmt and lint
Check Deno code / Check Deno code (pull_request) Failing after 8s
Tests / Unit tests (pull_request) Successful in 10s
Tests / Integration tests (pull_request) Successful in 54s
33a1ec9666
djalim force-pushed PMPR-111 from 2406c3c64b to 33a1ec9666 2026-04-26 13:33:51 +00:00 Compare
djalim closed this pull request 2026-04-26 16:26:48 +00:00
Some checks are pending
Check Deno code / Check Deno code (pull_request) Failing after 8s
Tests / Unit tests (pull_request) Successful in 10s
Tests / Integration tests (pull_request) Successful in 54s

Pull request closed

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#141