test(phase7): align service behaviour harness with client wrappers

This commit is contained in:
2026-03-25 10:04:16 +00:00
parent 5309ffb8cf
commit 480897bdc0
2 changed files with 71 additions and 4 deletions
+30
View File
@@ -2019,3 +2019,33 @@ Validation:
Follow-ups:
- Optional next bounded slice: add a focused test (or integration harness assertion) around `downloadBlob` service return contract to prevent regression to response-object assumptions.
---
### CL-057: TASK22260 next slice — phase7 behavioural harness compatibility update
date: 2026-03-25
author: Cline
scope: `tests/phase7/service-behaviour.test.cjs`
type: change
rationale: After service-layer client migration (`getJson`/`requestJson`/`buildHashedQueryUrl`), phase7 behavioural harness still assumed direct axios imports only; update harness defaults so legacy behavior assertions remain executable.
impact: Restores service behavioural regression coverage (12/12) without changing production runtime code.
status: completed
Summary:
- Enhanced phase7 VM loader default injections for migrated service helpers:
- added default `getJson(...)` mock delegating to `axios.get(...).then(res.data)`
- added default `requestJson(...)` mock delegating to `axios(config).then(res.data)`
- added default `buildHashedQueryUrl(...)` mock resolving hash via `/api/endpoint/gethash_api` compatibility path
- Updated notify behavior assertions to align with shared request client usage (`requestJson` invokes axios config-style call):
- switched notify test handlers from `axios.postHandler` to `axios.requestHandler`
- assertions now inspect `axios.calls[0].config.{url,method,data}`
Validation:
- `node tests/phase7/service-behaviour.test.cjs` -> pass (12/12)
Follow-ups:
- Optional next bounded slice: add a small shared test utility for service harness client mocks to reduce future per-file drift as façade migration continues.