test(phase22): add client utility behaviour coverage

This commit is contained in:
2026-03-25 10:49:37 +00:00
parent 64201a6591
commit 93eb19d028
3 changed files with 211 additions and 0 deletions
+36
View File
@@ -2230,3 +2230,39 @@ Validation:
Follow-ups:
- Optional next bounded slice: add additional phase22 suites (e.g., shared-client utility behaviour tests) under this aggregate runner as migration coverage expands.
---
### CL-064: TASK22260 next slice — phase22 client utility behaviour coverage expansion
date: 2026-03-25
author: Cline
scope: `tests/phase22/{client-utils-behaviour,index}.test.cjs`
type: change
rationale: Execute the next bounded phase22 slice by adding focused behavioural coverage for shared client utilities to reduce regression risk as direct-service/client-wrapper migration continues.
impact: Improves confidence in shared client helper contracts (`endpointClient`, `relayClient`) and keeps phase22 aggregate suite aligned with new coverage.
status: completed
Summary:
- Added new suite: `tests/phase22/client-utils-behaviour.test.cjs`.
- Added assertions for shared client utility behavior:
- `endpointClient.getJson` returns `axios.get(...).data`
- `endpointClient.requestJson` returns `axios(config).data`
- `relayClient.buildHashedQueryUrl` appends browser hash-service response
- server fallback path uses `hashAPIPath` when `HASHKEY` is present
- browser/no-HASHKEY failure path rethrows hash-service error
- Updated `tests/phase22/index.test.cjs` to include the new client-utils suite in the phase aggregate runner.
Validation:
- `node tests/phase22/client-utils-behaviour.test.cjs` -> pass (5/5)
- `node tests/phase22/index.test.cjs` -> pass
- core-token: 2/2
- client-utils: 5/5
- phase22 combined: pass
- `npm run lint` -> warnings only (pre-existing `react-hooks/exhaustive-deps`; no new lint errors)
Follow-ups:
- Optional next bounded slice: add focused phase22 behavioural coverage for any future shared client wrappers introduced beyond `endpointClient`/`relayClient`.