mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-12 22:26:13 +00:00
Settle the suite-wide fallout of the wave
The evaluator stubs hoist properly for vitest's factory rewrite, the WHOOP webhook route test's prisma double learns the pre-image read the delete branch now performs, and the connector-token card description shrinks to the one-sentence, 120-character shape the card guard enforces — still saying what the mint truthfully does.
This commit is contained in:
1 parent
2b3a67d43c
commit
8ee123d06b
9 files changed
+20
-13
No files matched your search
@@ -11,7 +11,10 @@ vi.mock("@/lib/api-handler", () => ({
|
||||
vi.mock("@/lib/db", () => ({
|
||||
prisma: {
|
||||
whoopConnection: { findUnique: vi.fn() },
|
||||
measurement: { updateMany: vi.fn() },
|
||||
measurement: {
|
||||
updateMany: vi.fn(),
|
||||
findMany: vi.fn(async () => []),
|
||||
},
|
||||
workout: { deleteMany: vi.fn() },
|
||||
},
|
||||
}));
|
||||
|
||||
@@ -21,9 +21,11 @@ vi.mock("@/lib/ai/coach/bytes-codec", () => ({
|
||||
|
||||
// The context-cue backstop delegates to the shared evaluator; its own
|
||||
// behaviour is pinned in `ai/coach/__tests__/context-reminders.test.ts`.
|
||||
const contextEvaluateMock = vi.fn(async (..._args: unknown[]) => ({
|
||||
surfaced: 0,
|
||||
errored: 0,
|
||||
const { contextEvaluateMock } = vi.hoisted(() => ({
|
||||
contextEvaluateMock: vi.fn(async (..._args: unknown[]) => ({
|
||||
surfaced: 0,
|
||||
errored: 0,
|
||||
})),
|
||||
}));
|
||||
vi.mock("@/lib/ai/coach/context-reminders", () => ({
|
||||
evaluateCoachContextReminders: contextEvaluateMock,
|
||||
|
||||
@@ -21,9 +21,11 @@ vi.mock("@/lib/jobs/boss-instance", () => ({
|
||||
// the Vorsorge assertions stay isolated; one test below pins that the hook
|
||||
// actually fires (watched red: removing the call site in
|
||||
// `runReminderSatisfyForUser` fails it).
|
||||
const evaluateContextMock = vi.fn(async (..._args: unknown[]) => ({
|
||||
surfaced: 0,
|
||||
errored: 0,
|
||||
const { evaluateContextMock } = vi.hoisted(() => ({
|
||||
evaluateContextMock: vi.fn(async (..._args: unknown[]) => ({
|
||||
surfaced: 0,
|
||||
errored: 0,
|
||||
})),
|
||||
}));
|
||||
vi.mock("@/lib/ai/coach/context-reminders", () => ({
|
||||
evaluateCoachContextReminders: evaluateContextMock,
|
||||
|
||||
Reference in new issue
Block a user