test: follow the newest-entry read and the pulse card toast count

This commit is contained in:
Marc-André Bombeck committed 2026-10-16 06:05:08 +02:00
1 parent f715190703
commit 852433255c
3 files changed
+7 -5

No files matched your search

@@ -37,7 +37,7 @@ vi.mock("@/lib/db", () => ({
userHealthProfile: { findUnique: vi.fn() },
healthProfileFactRevision: { findMany: vi.fn() },
// v1.43 — the anamnesis leaf also carries the newest AUDIT-C entry.
mentalHealthAssessment: { findFirst: vi.fn(async () => null) },
mentalHealthAssessment: { findMany: vi.fn(async () => []) },
user: { findUnique: vi.fn(), update: vi.fn() },
// The whole-record gate reads the session's own stamps: a sign-in a
// moment ago is the proof, on an account without a second factor.
+5 -3
View File
@@ -106,10 +106,12 @@ export function PulseDayMeanCard() {
? t("admin.section.pulseDayMean.applied")
: t("admin.section.pulseDayMean.appliedNoRebuild"),
);
} else if (action === "rebuild") {
toast.success(t("admin.section.pulseDayMean.rebuildStarted"));
} else {
toast.success(t("admin.section.pulseDayMean.dryRunStarted"));
toast.success(
action === "rebuild"
? t("admin.section.pulseDayMean.rebuildStarted")
: t("admin.section.pulseDayMean.dryRunStarted"),
);
}
void queryClient.invalidateQueries({
queryKey: queryKeys.adminPulseDayMean(),
+1 -1
View File
@@ -13,7 +13,7 @@
* Server-only.
*/
import { Prisma } from "@/generated/prisma/client";
import { decryptFromBytes, encryptToBytes } from "@/lib/ai/coach/bytes-codec";
import { encryptToBytes } from "@/lib/ai/coach/bytes-codec";
import { deriveAgeYears } from "@/lib/ai/coach/about-me";
import {
AUDIT_C_HISTORY_LIMIT,