fix(tests): update remaining mock paths and keys after schema rename

This commit is contained in:
Chris Parsons 2026-05-01 19:18:34 +00:00
parent b5b60a6093
commit 43304f4a8d
No known key found for this signature in database
5 changed files with 13 additions and 13 deletions

View file

@ -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",

View file

@ -45,7 +45,7 @@ function makeDb(opts: MakeDbOpts = {}) {
scoringEvents: {
findMany: vi.fn().mockResolvedValue(scoringEvents),
},
participantQualifyingTotals: {
seasonParticipantQualifyingTotals: {
findMany: vi.fn().mockResolvedValue(qualifyingTotals),
},
},

View file

@ -21,7 +21,7 @@ vi.mock("~/models/draft-pick", () => ({
isParticipantDrafted: vi.fn(),
}));
vi.mock("~/models/participant", () => ({
vi.mock("~/models/season-participant", () => ({
getParticipantsForSeasonWithSports: vi.fn(),
}));

View file

@ -25,8 +25,8 @@ vi.mock("~/database/context", () => ({
}));
vi.mock("~/database/schema", () => ({
participants: { id: "id" },
participantExpectedValues: {
seasonParticipants: { id: "id" },
seasonParticipantExpectedValues: {
participantId: "participantId",
sportsSeasonId: "sportsSeasonId",
},

View file

@ -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: {