style: satisfy v1.34.1 format gate

This commit is contained in:
Marc-André Bombeck committed 2026-07-29 15:59:12 +02:00
1 parent b0a94b3423
commit 75aa850eae
10 files changed
+71 -59

No files matched your search

@@ -367,22 +367,22 @@ describe("B5b — MCP health reads require an explicit read grant", () => {
);
it.each([
[
"expired",
{ expiresAt: new Date("2020-01-01T00:00:00.000Z") },
],
["expired", { expiresAt: new Date("2020-01-01T00:00:00.000Z") }],
["revoked", { revoked: true }],
])("denies an explicit but %s health:read credential", async (_label, state) => {
const raw = await armExpiringToken(
["health:read"],
`mcp-${_label}`,
state,
);
])(
"denies an explicit but %s health:read credential",
async (_label, state) => {
const raw = await armExpiringToken(
["health:read"],
`mcp-${_label}`,
state,
);
const res = await postMcp(raw, "tools/list");
const res = await postMcp(raw, "tools/list");
expect([401, 403]).toContain(res.status);
});
expect([401, 403]).toContain(res.status);
},
);
});
describe("B6 — a declared scope grants only what it names", () => {
@@ -209,9 +209,9 @@ describe("MCP OAuth refresh rotation (real PostgreSQL)", () => {
responses.map((response) => response.json() as Promise<TokenBody>),
);
const returnedSuccessors = bodies.filter(
(body): body is Required<
Pick<TokenBody, "access_token" | "refresh_token">
> =>
(
body,
): body is Required<Pick<TokenBody, "access_token" | "refresh_token">> =>
typeof body.access_token === "string" &&
typeof body.refresh_token === "string",
);
@@ -18,8 +18,7 @@ vi.mock("@/lib/rollups/medication-compliance-rollups", () => ({
recomputeMedicationComplianceForEvent: vi.fn().mockResolvedValue(undefined),
}));
const { dispatchNotification } =
await import("@/lib/notifications/dispatcher");
const { dispatchNotification } = await import("@/lib/notifications/dispatcher");
const { handleReminderCheck } =
await import("@/lib/jobs/reminder/medication-reminder-check");
@@ -100,25 +100,21 @@ async function readConsumerOccurrence(
const medication = raw as unknown as DueDerivationMedication;
const listOccurrence = medication.nextDueAt ?? null;
const dashboard = await buildMedsTodayBlock(
prisma,
USER_ID,
USER_TZ,
NOW,
);
const dashboard = await buildMedsTodayBlock(prisma, USER_ID, USER_TZ, NOW);
// A prior-day rolling slot is outside today's clock window. The GLP-1
// card therefore displays the server's canonical nextDueAt verbatim.
const glp1Occurrence = resolveDisplayedSlotInstant({
currentWindowStatus: {
status: null,
schedule: null,
window: null,
},
nextDueAt: listOccurrence,
now: NOW,
timeZone: USER_TZ,
})?.toISOString() ?? null;
const glp1Occurrence =
resolveDisplayedSlotInstant({
currentWindowStatus: {
status: null,
schedule: null,
window: null,
},
nextDueAt: listOccurrence,
now: NOW,
timeZone: USER_TZ,
})?.toISOString() ?? null;
const takeAll = deriveDueMedications([medication], {
now: NOW,
@@ -144,8 +140,10 @@ async function readConsumerOccurrence(
)?.overdue ?? false,
},
glp1Card: glp1Occurrence,
takeAllDue: takeAll.find((entry) => entry.id === medicationId)
?.scheduledFor?.toISOString() ?? null,
takeAllDue:
takeAll
.find((entry) => entry.id === medicationId)
?.scheduledFor?.toISOString() ?? null,
};
}
@@ -178,9 +176,7 @@ describe("rolling weekly overdue occurrence — shared consumers", () => {
medicationId,
scheduledFor: OVERDUE_OCCURRENCE,
takenAt:
status === "taken"
? new Date("2026-07-28T06:10:00.000Z")
: null,
status === "taken" ? new Date("2026-07-28T06:10:00.000Z") : null,
skipped: status === "skipped",
autoMissed: status === "autoMissed",
source: "WEB",