From 1d368b7cd223ab496584be2f41bb5acb0c91d81a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Tue, 7 Jul 2026 13:18:30 +0200 Subject: [PATCH] test(dashboard): repoint the disableCoach grep-guard at the shared snapshot read The cached-snapshot read moved from the API route body into src/lib/dashboard/snapshot-read.ts (shared by the route and the dashboard RSC prefetch); the bidirectional allowlist follows the user.disableCoach read to its new home. H4 --- .../feature-flags/__tests__/coach-user-disable.test.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lib/feature-flags/__tests__/coach-user-disable.test.tsx b/src/lib/feature-flags/__tests__/coach-user-disable.test.tsx index d16ea3cf3..3b259bace 100644 --- a/src/lib/feature-flags/__tests__/coach-user-disable.test.tsx +++ b/src/lib/feature-flags/__tests__/coach-user-disable.test.tsx @@ -323,11 +323,12 @@ describe("Coach per-user disableCoach invariant", () => { // v1.7.0 W6 — the unified dashboard snapshot builder reads // `user.disableCoach` to gate the embedded daily briefing to // `briefingState: "disabled"`. Covered by the briefingState matrix - // in `src/lib/dashboard/__tests__/snapshot.test.ts`. The route is - // a thin pass-through of the resolved session user into the - // builder. + // in `src/lib/dashboard/__tests__/snapshot.test.ts`. The shared + // cached-read helper (used by BOTH the API route and the dashboard + // RSC prefetch) maps the session user's flag into the builder + // input; the route itself no longer touches the flag. "src/lib/dashboard/snapshot.ts", - "src/app/api/dashboard/snapshot/route.ts", + "src/lib/dashboard/snapshot-read.ts", // v1.18.0 — the module enable/disable gate delegates the `coach` // module to the SAME two-layer source of truth (`user.disableCoach` // AND the operator assistant master flag) rather than owning a