test(settings): fix stale billing route path in module-gating tests #225

Merged
nrupard merged 1 commit from fix/pms-290-settings-stale-billing-path into main 2026-06-13 20:41:18 +02:00
Owner

Summary

Fixes cargo test --test settings failing on main. Closes PMS-290.

Two module-gating tests (disabled_module_returns_404_on_route_access, enabled_module_response_unchanged) probe RequireBilling by hitting a billing route, but used GET /api/v1/billing/invoices. The PMS-198 convergence refactor moved billing to absolute paths (billing/routes.rs: .route("/invoices", ...)), so the live endpoint is /api/v1/invoices. The stale path matched no route and 404'd as not-found, which the test misread as "module disabled" - failing with billing must be enabled at start, got 404.

Change

Point all four /api/v1/billing/invoices?per_page=5 occurrences in tests/settings.rs at /api/v1/invoices?per_page=5. No production change: /api/v1/invoices is billing-module-gated via RequireBilling, so the enabled-200 / disabled-404 / re-enabled-200 flow holds. tests/billing.rs and e2e/tests/billing.spec.ts already use the correct path.

Verification

  • cargo test -p mokosh-server --test settings: 10 passed (was 8 passed / 2 failed).
  • cargo fmt --all --check clean.
## Summary Fixes `cargo test --test settings` failing on `main`. Closes PMS-290. Two module-gating tests (`disabled_module_returns_404_on_route_access`, `enabled_module_response_unchanged`) probe `RequireBilling` by hitting a billing route, but used `GET /api/v1/billing/invoices`. The PMS-198 convergence refactor moved billing to absolute paths (`billing/routes.rs`: `.route("/invoices", ...)`), so the live endpoint is `/api/v1/invoices`. The stale path matched no route and 404'd as not-found, which the test misread as "module disabled" - failing with `billing must be enabled at start, got 404`. ## Change Point all four `/api/v1/billing/invoices?per_page=5` occurrences in `tests/settings.rs` at `/api/v1/invoices?per_page=5`. No production change: `/api/v1/invoices` is billing-module-gated via `RequireBilling`, so the enabled-200 / disabled-404 / re-enabled-200 flow holds. `tests/billing.rs` and `e2e/tests/billing.spec.ts` already use the correct path. ## Verification - `cargo test -p mokosh-server --test settings`: 10 passed (was 8 passed / 2 failed). - `cargo fmt --all --check` clean.
test(settings): fix stale billing route path in module-gating tests
Some checks failed
E2E / Playwright against staging (pull_request) Failing after 44s
Check / fmt + clippy + compile + tests (pull_request) Successful in 4m16s
Create release / Create release from merged PR (pull_request) Has been skipped
a8589c08cb
The two module-gating probes (disabled_module_returns_404_on_route_access, enabled_module_response_unchanged) hit GET /api/v1/billing/invoices, but the PMS-198 convergence refactor moved billing to absolute paths (billing/routes.rs: .route("/invoices", ...)), so the live endpoint is /api/v1/invoices. The stale path matched no route and 404'd as not-found, which the test misread as the module being disabled - failing `cargo test --test settings` on main with "billing must be enabled at start, got 404".

Point all four occurrences at /api/v1/invoices. No production change: that route is billing-module-gated via RequireBilling, so the enabled-200 / disabled-404 / re-enabled-200 flow holds. tests/billing.rs and the e2e billing spec already use the correct path.

#PMS-290
nrupard deleted branch fix/pms-290-settings-stale-billing-path 2026-06-13 20:41:19 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-server!225
No description provided.