test(promotions): unit, integration & e2e tests for promotions CRUD #138

Merged
djalim merged 4 commits from PMPR-110 into develop 2026-04-26 13:33:07 +00:00
Collaborator

Summary

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

Summary --- - Unit tests: mock API (GET/POST/PUT/DELETE, 400/404) and mock DB CRUD for promotions - 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 #110
djalim force-pushed PMPR-110 from 7a91f552cb to 95700b0595 2026-04-26 12:36:05 +00:00 Compare
djalim force-pushed PMPR-110 from 95700b0595 to be2d8ad9d2 2026-04-26 13:02:39 +00:00 Compare
djalim force-pushed PMPR-110 from be2d8ad9d2 to baef519f1d 2026-04-26 13:04:34 +00:00 Compare
djalim force-pushed PMPR-110 from baef519f1d to 4387a46172 2026-04-26 13:07:08 +00:00 Compare
djalim added 4 commits 2026-04-26 13:08:05 +00:00
- unit: fixture shapes, mock API (GET/POST/PUT/DELETE), mock DB CRUD
- integration: real DB list, create, get, update, delete, not-found cases
- e2e: handler calls with mock context + real DB, covers 400/403/404 cases
chore: remove .github workflows (act only uses .gitea)
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 1m3s
Check Deno code / Check Deno code (push) Successful in 5s
Tests / Unit tests (push) Successful in 12s
Tests / Integration tests (push) Successful in 1m3s
e3eefd945c
djalim force-pushed PMPR-110 from 4387a46172 to e3eefd945c 2026-04-26 13:08:05 +00:00 Compare
djalim merged commit e3eefd945c into develop 2026-04-26 13:33:07 +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#138