fix(tests): update remaining mock paths and keys after schema rename
This commit is contained in:
parent
b5b60a6093
commit
43304f4a8d
5 changed files with 13 additions and 13 deletions
|
|
@ -8,7 +8,7 @@ vi.mock("~/models/draft-pick", () => ({
|
||||||
isParticipantDrafted: vi.fn(),
|
isParticipantDrafted: vi.fn(),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
vi.mock("~/models/participant", () => ({
|
vi.mock("~/models/season-participant", () => ({
|
||||||
getParticipantsForSeasonWithSports: vi.fn(),
|
getParticipantsForSeasonWithSports: vi.fn(),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
@ -148,7 +148,7 @@ describe("autoPickForTeam – queueOnly constraint (AC2 & AC3)", () => {
|
||||||
|
|
||||||
const mockDb = makeMockDb({
|
const mockDb = makeMockDb({
|
||||||
query: {
|
query: {
|
||||||
participants: {
|
seasonParticipants: {
|
||||||
findMany: vi.fn().mockResolvedValue([
|
findMany: vi.fn().mockResolvedValue([
|
||||||
{
|
{
|
||||||
id: "p-1",
|
id: "p-1",
|
||||||
|
|
@ -188,7 +188,7 @@ describe("autoPickForTeam – queueOnly constraint (AC2 & AC3)", () => {
|
||||||
const mockWhere = vi.fn().mockResolvedValue(undefined);
|
const mockWhere = vi.fn().mockResolvedValue(undefined);
|
||||||
const mockDb = makeMockDb({
|
const mockDb = makeMockDb({
|
||||||
query: {
|
query: {
|
||||||
participants: {
|
seasonParticipants: {
|
||||||
findMany: vi.fn().mockResolvedValue([
|
findMany: vi.fn().mockResolvedValue([
|
||||||
{
|
{
|
||||||
id: "p-1",
|
id: "p-1",
|
||||||
|
|
@ -233,7 +233,7 @@ describe("autoPickForTeam – queueOnly constraint (AC2 & AC3)", () => {
|
||||||
const mockWhere = vi.fn().mockResolvedValue(undefined);
|
const mockWhere = vi.fn().mockResolvedValue(undefined);
|
||||||
const mockDb = makeMockDb({
|
const mockDb = makeMockDb({
|
||||||
query: {
|
query: {
|
||||||
participants: {
|
seasonParticipants: {
|
||||||
findMany: vi.fn().mockResolvedValue([
|
findMany: vi.fn().mockResolvedValue([
|
||||||
{
|
{
|
||||||
id: "p-snooker",
|
id: "p-snooker",
|
||||||
|
|
@ -280,7 +280,7 @@ describe("autoPickForTeam – queueOnly constraint (AC2 & AC3)", () => {
|
||||||
// 4. select().from(participants).where().orderBy() — participant query (chain)
|
// 4. select().from(participants).where().orderBy() — participant query (chain)
|
||||||
const mockDb = {
|
const mockDb = {
|
||||||
query: {
|
query: {
|
||||||
participants: {
|
seasonParticipants: {
|
||||||
findMany: vi.fn().mockResolvedValue([
|
findMany: vi.fn().mockResolvedValue([
|
||||||
{
|
{
|
||||||
id: "p-snooker",
|
id: "p-snooker",
|
||||||
|
|
@ -330,7 +330,7 @@ describe("autoPickForTeam – queueOnly constraint (AC2 & AC3)", () => {
|
||||||
|
|
||||||
const mockDb = makeMockDb({
|
const mockDb = makeMockDb({
|
||||||
query: {
|
query: {
|
||||||
participants: {
|
seasonParticipants: {
|
||||||
findMany: vi.fn().mockResolvedValue([
|
findMany: vi.fn().mockResolvedValue([
|
||||||
{
|
{
|
||||||
id: "p-1",
|
id: "p-1",
|
||||||
|
|
@ -373,7 +373,7 @@ describe("autoPickForTeam – queueOnly constraint (AC2 & AC3)", () => {
|
||||||
|
|
||||||
const mockDb = makeMockDb({
|
const mockDb = makeMockDb({
|
||||||
query: {
|
query: {
|
||||||
participants: {
|
seasonParticipants: {
|
||||||
findMany: vi.fn().mockResolvedValue([
|
findMany: vi.fn().mockResolvedValue([
|
||||||
{
|
{
|
||||||
id: "p-1",
|
id: "p-1",
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ function makeDb(opts: MakeDbOpts = {}) {
|
||||||
scoringEvents: {
|
scoringEvents: {
|
||||||
findMany: vi.fn().mockResolvedValue(scoringEvents),
|
findMany: vi.fn().mockResolvedValue(scoringEvents),
|
||||||
},
|
},
|
||||||
participantQualifyingTotals: {
|
seasonParticipantQualifyingTotals: {
|
||||||
findMany: vi.fn().mockResolvedValue(qualifyingTotals),
|
findMany: vi.fn().mockResolvedValue(qualifyingTotals),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ vi.mock("~/models/draft-pick", () => ({
|
||||||
isParticipantDrafted: vi.fn(),
|
isParticipantDrafted: vi.fn(),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
vi.mock("~/models/participant", () => ({
|
vi.mock("~/models/season-participant", () => ({
|
||||||
getParticipantsForSeasonWithSports: vi.fn(),
|
getParticipantsForSeasonWithSports: vi.fn(),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,8 @@ vi.mock("~/database/context", () => ({
|
||||||
}));
|
}));
|
||||||
|
|
||||||
vi.mock("~/database/schema", () => ({
|
vi.mock("~/database/schema", () => ({
|
||||||
participants: { id: "id" },
|
seasonParticipants: { id: "id" },
|
||||||
participantExpectedValues: {
|
seasonParticipantExpectedValues: {
|
||||||
participantId: "participantId",
|
participantId: "participantId",
|
||||||
sportsSeasonId: "sportsSeasonId",
|
sportsSeasonId: "sportsSeasonId",
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ function makeDb(existingResult?: { id: string; isPartialScore: boolean }) {
|
||||||
insert: vi.fn().mockReturnValue({ values: insertValues }),
|
insert: vi.fn().mockReturnValue({ values: insertValues }),
|
||||||
update: vi.fn().mockReturnValue({ set: updateSet }),
|
update: vi.fn().mockReturnValue({ set: updateSet }),
|
||||||
query: {
|
query: {
|
||||||
participantResults: { findFirst },
|
seasonParticipantResults: { findFirst },
|
||||||
seasonSports: {
|
seasonSports: {
|
||||||
findMany: vi.fn().mockResolvedValue([]), // empty → standings loop exits immediately
|
findMany: vi.fn().mockResolvedValue([]), // empty → standings loop exits immediately
|
||||||
},
|
},
|
||||||
|
|
@ -433,7 +433,7 @@ describe("processPlayoffEvent - NBA Play-In Round 1 loserAdvances fix", () => {
|
||||||
participants: {
|
participants: {
|
||||||
findMany: vi.fn().mockResolvedValue([]),
|
findMany: vi.fn().mockResolvedValue([]),
|
||||||
},
|
},
|
||||||
participantResults: {
|
seasonParticipantResults: {
|
||||||
findFirst: vi.fn().mockResolvedValue(undefined),
|
findFirst: vi.fn().mockResolvedValue(undefined),
|
||||||
},
|
},
|
||||||
seasons: {
|
seasons: {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue