mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-13 14:32:03 +00:00
style: apply prettier across the tree
One-shot prettier pass so the new format:check gate starts from a clean baseline. Formatting only — no behaviour change. Generator-owned and vendored artifacts stay untouched via .prettierignore.
This commit is contained in:
1 parent
b3fea2ef59
commit
1f4ba5939d
1000 files changed
+12130
-8385
No files matched your search
@@ -123,9 +123,8 @@ describe("withings/callback atomic nonce consumption (M3)", () => {
|
||||
|
||||
// Stub the rest of the happy path for the winning request — code
|
||||
// exchange returns plausible tokens so the upsert + redirect run.
|
||||
const { getUserWithingsCredentials } = await import(
|
||||
"@/lib/withings/credentials"
|
||||
);
|
||||
const { getUserWithingsCredentials } =
|
||||
await import("@/lib/withings/credentials");
|
||||
vi.mocked(getUserWithingsCredentials).mockResolvedValue({
|
||||
clientId: "cid",
|
||||
clientSecret: "csec",
|
||||
@@ -155,13 +154,9 @@ describe("withings/callback atomic nonce consumption (M3)", () => {
|
||||
|
||||
// Exactly one leg landed on `withings=connected`, exactly one
|
||||
// landed on the replay branch (`withings=error&reason=replay`).
|
||||
const locations = [resA, resB]
|
||||
.map((r) => r.headers.get("location"))
|
||||
.sort();
|
||||
const locations = [resA, resB].map((r) => r.headers.get("location")).sort();
|
||||
expect(locations).toHaveLength(2);
|
||||
expect(
|
||||
locations.some((l) => l?.includes("withings=connected")),
|
||||
).toBe(true);
|
||||
expect(locations.some((l) => l?.includes("withings=connected"))).toBe(true);
|
||||
expect(
|
||||
locations.some((l) => l?.includes("withings=error&reason=replay")),
|
||||
).toBe(true);
|
||||
@@ -265,7 +260,9 @@ describe("withings/callback atomic nonce consumption (M3)", () => {
|
||||
"withings=error&reason=cross_user",
|
||||
);
|
||||
expect(exchangeCode).not.toHaveBeenCalled();
|
||||
expect(annotateMock).toHaveBeenCalledWith({ meta: { reason: "cross_user" } });
|
||||
expect(annotateMock).toHaveBeenCalledWith({
|
||||
meta: { reason: "cross_user" },
|
||||
});
|
||||
});
|
||||
|
||||
it("non-P2025 infra error branch annotates reason=state on the Wide Event (legacy fallback for unclassified DB failures)", async () => {
|
||||
@@ -295,7 +292,10 @@ describe("withings/callback atomic nonce consumption (M3)", () => {
|
||||
// CSRF leg 1 — must reject without touching the ledger so a
|
||||
// probe can't grief legitimate rows by issuing deletes for
|
||||
// nonces it doesn't legitimately hold the cookie for.
|
||||
const req = callbackRequest("aaaaaaaaaaaaaaaaaaaaaa", "bbbbbbbbbbbbbbbbbbbbbb");
|
||||
const req = callbackRequest(
|
||||
"aaaaaaaaaaaaaaaaaaaaaa",
|
||||
"bbbbbbbbbbbbbbbbbbbbbb",
|
||||
);
|
||||
const res = await GET(req);
|
||||
|
||||
expect(res.status).toBe(307);
|
||||
|
||||
Reference in new issue
Block a user