mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 13:01:00 +00:00
test: type the off-spec WHOOP profile and drop a version-stamped comment
The realism ratchet counts as-never casts and the version-stamp ratchet refuses comment lines that open with a release; both caught the previous commits.
This commit is contained in:
1 parent
369c063701
commit
087c8868cf
2 files changed
+7
-4
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import { describe, it, expect, vi, beforeEach } from "vitest";
|
||||
import type { WhoopProfile } from "@/lib/whoop/wire-types";
|
||||
|
||||
// Single-use claiming is covered against Postgres in
|
||||
// tests/integration/oauth-callback-single-use.test.ts. Here the state row is
|
||||
@@ -182,7 +183,9 @@ describe("GET /api/whoop/callback custom-scheme redirect", () => {
|
||||
returnScheme: null,
|
||||
});
|
||||
const { fetchProfile } = await import("@/lib/whoop/client");
|
||||
vi.mocked(fetchProfile).mockResolvedValueOnce({} as never);
|
||||
// An off-spec body: the wire type says user_id is always there.
|
||||
const offSpec: Partial<WhoopProfile> = {};
|
||||
vi.mocked(fetchProfile).mockResolvedValueOnce(offSpec as WhoopProfile);
|
||||
|
||||
const res = await GET(makeReq("nonce-noid"));
|
||||
|
||||
|
||||
@@ -56,9 +56,9 @@ export async function healGoogleHealthAccountId(
|
||||
}
|
||||
|
||||
/**
|
||||
* The sync cycle's hook: after a clean cycle, a connection from before
|
||||
* v1.46.4 (no account id since migration 0491) reads its id back. A
|
||||
* connection that has one is left alone, so the profile is read once.
|
||||
* The sync cycle's hook: after a clean cycle, a connection that migration
|
||||
* 0491 left without an account id reads it back. A connection that has one
|
||||
* is left alone, so the profile is read once.
|
||||
*/
|
||||
export async function healUnknownGoogleHealthAccountId(
|
||||
userId: string,
|
||||
|
||||
Reference in new issue
Block a user