From 0f9ee08a48bd8f63cf6b82c23b6363e5036df8e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 25 Oct 2026 00:51:32 +0200 Subject: [PATCH] test(sync): give the module-gate double the mirror walk's token lookup The walk now asks the token table first; the route test's Prisma double answers it with no switched token. --- src/app/api/sync/changes/__tests__/module-gate.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app/api/sync/changes/__tests__/module-gate.test.ts b/src/app/api/sync/changes/__tests__/module-gate.test.ts index e75cd7145..9640f30c1 100644 --- a/src/app/api/sync/changes/__tests__/module-gate.test.ts +++ b/src/app/api/sync/changes/__tests__/module-gate.test.ts @@ -22,6 +22,8 @@ vi.mock("@/lib/modules/gate", () => ({ isModuleEnabled: vi.fn() })); vi.mock("@/lib/db", () => ({ prisma: { measurement: { findMany: vi.fn() }, + // The mirror walk's token lookup: no token switched, so no walk. + apiToken: { findMany: vi.fn(async () => []) }, moodEntry: { findMany: vi.fn() }, medicationIntakeEvent: { findMany: vi.fn() }, cycleDayLog: { findMany: vi.fn() },