test(settings): fix stale billing route path in module-gating tests #225
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/pms-290-settings-stale-billing-path"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes
cargo test --test settingsfailing onmain. Closes PMS-290.Two module-gating tests (
disabled_module_returns_404_on_route_access,enabled_module_response_unchanged) probeRequireBillingby hitting a billing route, but usedGET /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 withbilling must be enabled at start, got 404.Change
Point all four
/api/v1/billing/invoices?per_page=5occurrences intests/settings.rsat/api/v1/invoices?per_page=5. No production change:/api/v1/invoicesis billing-module-gated viaRequireBilling, so the enabled-200 / disabled-404 / re-enabled-200 flow holds.tests/billing.rsande2e/tests/billing.spec.tsalready use the correct path.Verification
cargo test -p mokosh-server --test settings: 10 passed (was 8 passed / 2 failed).cargo fmt --all --checkclean.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