Skip to content

Commit 256dcd5

Browse files
tylerslatonclaude
andcommitted
test(shell-dashboard): refresh depth-utils tests post dual-claim drop
The previous "multi-key D5 mapping" tests used `shared-state-read-write` as the example, but with the dual-claim drop that registry-id is now single-key (only `shared-state-write`). Tests still passed logically but the names were misleading. - Rewrote both shared-state-read-write tests to assert the new single-key contract directly (no more `d5:lgp/shared-state-read` row in the live map — that row belongs to a different cell now). - Added new beautiful-chat tests as the canonical multi-key example (5 per-pill literals) so the multi-key code path stays exercised. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d16475c commit 256dcd5

1 file changed

Lines changed: 44 additions & 4 deletions

File tree

showcase/shell-dashboard/src/components/__tests__/depth-utils.test.ts

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -282,34 +282,74 @@ describe("deriveDepth", () => {
282282
expect(result.achieved).toBe(4);
283283
});
284284

285-
it("returns D5 for multi-key D5 mapping (shared-state-read-write)", () => {
285+
it("returns D5 for shared-state-read-write when its single d5 row (write) is green", () => {
286+
// shared-state-read-write maps to ["shared-state-write"] only —
287+
// the read literal is owned by the standalone /demos/shared-state-read
288+
// recipe-editor probe and writes to its own d5:lgp/shared-state-read
289+
// row that does NOT factor into this cell's depth calculation.
286290
const c = cell("lgp", "shared-state-read-write");
287291
const live = mapOf([
288292
row("health:lgp", "health", "green"),
289293
row("agent:lgp", "agent", "green"),
290294
row("e2e:lgp/shared-state-read-write", "e2e", "green"),
291295
row("tools:lgp", "tools", "green"),
292-
row("d5:lgp/shared-state-read", "d5", "green"),
293296
row("d5:lgp/shared-state-write", "d5", "green"),
294297
]);
295298
const result = deriveDepth(c, live);
296299
expect(result.achieved).toBe(5);
297300
});
298301

299-
it("returns D4 when one of multi-key D5 rows is red", () => {
302+
it("returns D4 when shared-state-read-write's d5 write row is red", () => {
300303
const c = cell("lgp", "shared-state-read-write");
301304
const live = mapOf([
302305
row("health:lgp", "health", "green"),
303306
row("agent:lgp", "agent", "green"),
304307
row("e2e:lgp/shared-state-read-write", "e2e", "green"),
305308
row("tools:lgp", "tools", "green"),
306-
row("d5:lgp/shared-state-read", "d5", "green"),
307309
row("d5:lgp/shared-state-write", "d5", "red"),
308310
]);
309311
const result = deriveDepth(c, live);
310312
expect(result.achieved).toBe(4);
311313
});
312314

315+
it("returns D5 for multi-key D5 mapping (beautiful-chat → 5 per-pill literals)", () => {
316+
// beautiful-chat is the canonical multi-key example: it maps to 5
317+
// per-pill literals (toggle-theme / pie-chart / bar-chart /
318+
// search-flights / schedule-meeting). The cell hits D5 only when
319+
// every pill row is green.
320+
const c = cell("lgp", "beautiful-chat");
321+
const live = mapOf([
322+
row("health:lgp", "health", "green"),
323+
row("agent:lgp", "agent", "green"),
324+
row("e2e:lgp/beautiful-chat", "e2e", "green"),
325+
row("chat:lgp", "chat", "green"),
326+
row("d5:lgp/beautiful-chat-toggle-theme", "d5", "green"),
327+
row("d5:lgp/beautiful-chat-pie-chart", "d5", "green"),
328+
row("d5:lgp/beautiful-chat-bar-chart", "d5", "green"),
329+
row("d5:lgp/beautiful-chat-search-flights", "d5", "green"),
330+
row("d5:lgp/beautiful-chat-schedule-meeting", "d5", "green"),
331+
]);
332+
const result = deriveDepth(c, live);
333+
expect(result.achieved).toBe(5);
334+
});
335+
336+
it("returns D4 when ONE of beautiful-chat's 5 multi-key D5 rows is red", () => {
337+
const c = cell("lgp", "beautiful-chat");
338+
const live = mapOf([
339+
row("health:lgp", "health", "green"),
340+
row("agent:lgp", "agent", "green"),
341+
row("e2e:lgp/beautiful-chat", "e2e", "green"),
342+
row("chat:lgp", "chat", "green"),
343+
row("d5:lgp/beautiful-chat-toggle-theme", "d5", "green"),
344+
row("d5:lgp/beautiful-chat-pie-chart", "d5", "red"),
345+
row("d5:lgp/beautiful-chat-bar-chart", "d5", "green"),
346+
row("d5:lgp/beautiful-chat-search-flights", "d5", "green"),
347+
row("d5:lgp/beautiful-chat-schedule-meeting", "d5", "green"),
348+
]);
349+
const result = deriveDepth(c, live);
350+
expect(result.achieved).toBe(4);
351+
});
352+
313353
it("returns D6 when D0-D5 green plus D6 green", () => {
314354
const c = cell("lgp", "agentic-chat");
315355
const live = mapOf([

0 commit comments

Comments
 (0)