procurement-ingest/tests
Adam Moussa 8156b275a9
Some checks are pending
Deploy / deploy (push) Waiting to run
feat(api): stock Swagger UI for /docs (vendored offline) (#128)
* feat(api): use stock Swagger UI for the /docs page

Replaces the custom renderer with vendored stock Swagger UI
(swagger-ui-dist 5.17.14, Apache-2.0), kept offline (no CDN) and inlined
server-side into the single token-gated /docs response alongside the spec.
BaseLayout (topbar hidden); try-it-out disabled since data routes need SigV4
(use Postman for live calls). Breakout guards on the inlined css/js/spec.
Bundle-consistency + spec-drift + handler tests updated for the two vendored
assets. cdk diff = Lambda code asset only (no IAM/API/policy change).

* fix(api): render Swagger UI with the canonical StandaloneLayout recipe

The BaseLayout-only init (apis preset, no standalone preset) rendered
incorrectly. Switch to the canonical swagger-ui-dist recipe: vendor
swagger-ui-standalone-preset.js and init with
presets:[apis, SwaggerUIStandalonePreset] + layout:"StandaloneLayout"
(topbar hidden, try-it-out disabled). Verified via headless Chrome against
the live deployed page: all 9 endpoints + 4 webhooks + models render.
Tests/bundling updated for the third vendored asset.

* fix(api): declutter the Swagger UI docs page

The page rendered (stock Swagger UI, StandaloneLayout) but looked cramped:
a dense info.description wall of inline-code chips collided across Swagger
UI's tight default line-height, and the Servers box showed a SEE-STACK-OUTPUT
placeholder.

- Trim info.description to a few concise lines (detail lives in README + the
  webhook contract doc).
- Inject the live invoke URL into servers[0].url per request (from the API
  Gateway request context; committed literal is the fallback), so the Servers
  box shows the real endpoint and drops the server-variables section.
- CSS: loosen description line-height + inline-code padding so chips never
  overlap; tidy the scheme container spacing.
- Handler: cache the heavy CSS/JS/preset shell once; splice the (server-
  injected) spec per request.

Verified via headless Chrome against the live deployed page.
2026-07-23 20:19:47 -04:00
..
support feat(api): procurement-api read stack + OpenAPI docs (SHOC reconciliation path) (#127) 2026-07-23 19:32:20 -04:00
requirements.txt test: consolidate test roots — one loader, shared support, enforced CI floor (phase 8) (#118) 2026-07-20 16:19:15 -04:00
test_api_handlers.py feat(api): stock Swagger UI for /docs (vendored offline) (#128) 2026-07-23 20:19:47 -04:00
test_api_pagination_moto.py feat(api): procurement-api read stack + OpenAPI docs (SHOC reconciliation path) (#127) 2026-07-23 19:32:20 -04:00
test_api_spec_drift.py feat(api): stock Swagger UI for /docs (vendored offline) (#128) 2026-07-23 20:19:47 -04:00
test_bundle_consistency.py feat(api): stock Swagger UI for /docs (vendored offline) (#128) 2026-07-23 20:19:47 -04:00
test_handler_auth_seam.py test: consolidate test roots — one loader, shared support, enforced CI floor (phase 8) (#118) 2026-07-20 16:19:15 -04:00
test_parse_raw_email.py Add pytest suite and enable tests in CI (#95) 2026-07-15 19:06:20 -04:00
test_reprocess_contract.py Migrate to seahaven-prod: deploy role, backfill tooling, account-portability fixes (#125) 2026-07-23 17:08:47 -04:00
test_ses_auth.py fix(ses_auth): harden comment stripping and alarm evaluation window (#103) 2026-07-16 19:00:40 +00:00
test_web_ui_auth.py feat(api): procurement-api read stack + OpenAPI docs (SHOC reconciliation path) (#127) 2026-07-23 19:32:20 -04:00
test_web_ui_handlers.py test: consolidate test roots — one loader, shared support, enforced CI floor (phase 8) (#118) 2026-07-20 16:19:15 -04:00