From 43304f4a8dbbe955eb5a1ba07d3bc1bc10134618 Mon Sep 17 00:00:00 2001 From: Chris Parsons Date: Fri, 1 May 2026 19:18:34 +0000 Subject: [PATCH] fix(tests): update remaining mock paths and keys after schema rename --- app/models/__tests__/auto-pick.test.ts | 14 +++++++------- app/models/__tests__/draft-pick.test.ts | 2 +- app/models/__tests__/executeAutoPick.timer.test.ts | 2 +- .../__tests__/participant-expected-value.test.ts | 4 ++-- app/models/__tests__/process-match-result.test.ts | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/models/__tests__/auto-pick.test.ts b/app/models/__tests__/auto-pick.test.ts index b66fbe5..cba5bc8 100644 --- a/app/models/__tests__/auto-pick.test.ts +++ b/app/models/__tests__/auto-pick.test.ts @@ -8,7 +8,7 @@ vi.mock("~/models/draft-pick", () => ({ isParticipantDrafted: vi.fn(), })); -vi.mock("~/models/participant", () => ({ +vi.mock("~/models/season-participant", () => ({ getParticipantsForSeasonWithSports: vi.fn(), })); @@ -148,7 +148,7 @@ describe("autoPickForTeam – queueOnly constraint (AC2 & AC3)", () => { const mockDb = makeMockDb({ query: { - participants: { + seasonParticipants: { findMany: vi.fn().mockResolvedValue([ { id: "p-1", @@ -188,7 +188,7 @@ describe("autoPickForTeam – queueOnly constraint (AC2 & AC3)", () => { const mockWhere = vi.fn().mockResolvedValue(undefined); const mockDb = makeMockDb({ query: { - participants: { + seasonParticipants: { findMany: vi.fn().mockResolvedValue([ { id: "p-1", @@ -233,7 +233,7 @@ describe("autoPickForTeam – queueOnly constraint (AC2 & AC3)", () => { const mockWhere = vi.fn().mockResolvedValue(undefined); const mockDb = makeMockDb({ query: { - participants: { + seasonParticipants: { findMany: vi.fn().mockResolvedValue([ { id: "p-snooker", @@ -280,7 +280,7 @@ describe("autoPickForTeam – queueOnly constraint (AC2 & AC3)", () => { // 4. select().from(participants).where().orderBy() — participant query (chain) const mockDb = { query: { - participants: { + seasonParticipants: { findMany: vi.fn().mockResolvedValue([ { id: "p-snooker", @@ -330,7 +330,7 @@ describe("autoPickForTeam – queueOnly constraint (AC2 & AC3)", () => { const mockDb = makeMockDb({ query: { - participants: { + seasonParticipants: { findMany: vi.fn().mockResolvedValue([ { id: "p-1", @@ -373,7 +373,7 @@ describe("autoPickForTeam – queueOnly constraint (AC2 & AC3)", () => { const mockDb = makeMockDb({ query: { - participants: { + seasonParticipants: { findMany: vi.fn().mockResolvedValue([ { id: "p-1", diff --git a/app/models/__tests__/draft-pick.test.ts b/app/models/__tests__/draft-pick.test.ts index d6475a3..e335b11 100644 --- a/app/models/__tests__/draft-pick.test.ts +++ b/app/models/__tests__/draft-pick.test.ts @@ -45,7 +45,7 @@ function makeDb(opts: MakeDbOpts = {}) { scoringEvents: { findMany: vi.fn().mockResolvedValue(scoringEvents), }, - participantQualifyingTotals: { + seasonParticipantQualifyingTotals: { findMany: vi.fn().mockResolvedValue(qualifyingTotals), }, }, diff --git a/app/models/__tests__/executeAutoPick.timer.test.ts b/app/models/__tests__/executeAutoPick.timer.test.ts index 65b2516..593d8bf 100644 --- a/app/models/__tests__/executeAutoPick.timer.test.ts +++ b/app/models/__tests__/executeAutoPick.timer.test.ts @@ -21,7 +21,7 @@ vi.mock("~/models/draft-pick", () => ({ isParticipantDrafted: vi.fn(), })); -vi.mock("~/models/participant", () => ({ +vi.mock("~/models/season-participant", () => ({ getParticipantsForSeasonWithSports: vi.fn(), })); diff --git a/app/models/__tests__/participant-expected-value.test.ts b/app/models/__tests__/participant-expected-value.test.ts index 6f605a0..46b5569 100644 --- a/app/models/__tests__/participant-expected-value.test.ts +++ b/app/models/__tests__/participant-expected-value.test.ts @@ -25,8 +25,8 @@ vi.mock("~/database/context", () => ({ })); vi.mock("~/database/schema", () => ({ - participants: { id: "id" }, - participantExpectedValues: { + seasonParticipants: { id: "id" }, + seasonParticipantExpectedValues: { participantId: "participantId", sportsSeasonId: "sportsSeasonId", }, diff --git a/app/models/__tests__/process-match-result.test.ts b/app/models/__tests__/process-match-result.test.ts index 1112225..0d530b9 100644 --- a/app/models/__tests__/process-match-result.test.ts +++ b/app/models/__tests__/process-match-result.test.ts @@ -42,7 +42,7 @@ function makeDb(existingResult?: { id: string; isPartialScore: boolean }) { insert: vi.fn().mockReturnValue({ values: insertValues }), update: vi.fn().mockReturnValue({ set: updateSet }), query: { - participantResults: { findFirst }, + seasonParticipantResults: { findFirst }, seasonSports: { findMany: vi.fn().mockResolvedValue([]), // empty → standings loop exits immediately }, @@ -433,7 +433,7 @@ describe("processPlayoffEvent - NBA Play-In Round 1 loserAdvances fix", () => { participants: { findMany: vi.fn().mockResolvedValue([]), }, - participantResults: { + seasonParticipantResults: { findFirst: vi.fn().mockResolvedValue(undefined), }, seasons: {