Skip to content

Commit a080574

Browse files
committed
test(rest): the read-scope boundary double spells routes, not the retired endpoints (#5674)
`analytics-read-scope-refusal-envelope.test.ts` was written from a sibling analytics test before #5674 landed, so its `getDiscovery` double carried `endpoints: {}` -- the dispatcher-only copy of `routes` that #4828 retired under ADR-0049 and that no producer ever emitted. #5674 corrected the 26 existing doubles and added `discovery-double-retired-key.test.ts` to pin the key out of the fixture layer; this file arrived after that sweep and reintroduced it. Corrected to the producer's real shape -- `routes: { data: '', metadata: '' }`, `ApiRoutesSchema` as `DiscoverySchema` requires it -- matching the three sibling analytics doubles verbatim. The key was inert here (nothing in this file drives discovery), which is exactly the reason it kept surviving retirement, so this is the double being made faithful to its producer rather than a guard being satisfied.
1 parent 12751bb commit a080574

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

packages/rest/src/analytics-read-scope-refusal-envelope.test.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,14 @@ function mockServer() {
7171
}
7272
function mockProtocol() {
7373
return {
74-
getDiscovery: vi.fn().mockResolvedValue({ version: 'v0', endpoints: {} }),
74+
// [#5674] `routes` (ApiRoutesSchema) is what the producer emits and what
75+
// `DiscoverySchema` requires. This double was copy-pasted from a sibling
76+
// before #5674 landed and spelled `endpoints` — the dispatcher-only copy of
77+
// `routes` that #4828 retired under ADR-0049, and which no producer ever
78+
// emitted. It was inert here (nothing in this file drives discovery), which
79+
// is exactly why the key kept surviving; `discovery-double-retired-key.test.ts`
80+
// pins it out of the fixture layer so the next copy-paste cannot regrow it.
81+
getDiscovery: vi.fn().mockResolvedValue({ version: 'v0', routes: { data: '', metadata: '' } }),
7582
getMetaTypes: vi.fn().mockResolvedValue([]),
7683
getMetaItems: vi.fn().mockResolvedValue([]),
7784
};

0 commit comments

Comments
 (0)