diff --git a/app/models/__tests__/qualifying-points.test.ts b/app/models/__tests__/qualifying-points.test.ts index d56ab37..b74498a 100644 --- a/app/models/__tests__/qualifying-points.test.ts +++ b/app/models/__tests__/qualifying-points.test.ts @@ -19,7 +19,7 @@ describe("diffChangedQualifyingPoints", () => { { id: "C", qp: "3.00" }, // first-time score ]; - expect([...diffChangedQualifyingPoints(before, after)].sort()).toEqual(["B", "C"]); + expect([...diffChangedQualifyingPoints(before, after)].toSorted()).toEqual(["B", "C"]); }); it("normalizes decimal formatting so 10 and 10.00 are equal", () => { diff --git a/app/models/__tests__/scoring-calculator-qp-notify.test.ts b/app/models/__tests__/scoring-calculator-qp-notify.test.ts index c7c9f0b..b5470d5 100644 --- a/app/models/__tests__/scoring-calculator-qp-notify.test.ts +++ b/app/models/__tests__/scoring-calculator-qp-notify.test.ts @@ -1,4 +1,5 @@ import { describe, it, expect, vi, beforeEach } from "vitest"; +import type * as QualifyingPointsModule from "~/models/qualifying-points"; // Spy on the QP Discord notification, and no-op the per-participant total recalc // (its own eventResults query would otherwise interfere with the before/after @@ -8,7 +9,7 @@ vi.mock("~/services/qualifying-points-discord.server", () => ({ })); vi.mock("~/models/qualifying-points", async (importActual) => { - const actual = await importActual(); + const actual = await importActual(); return { ...actual, recalculateParticipantQP: vi.fn().mockResolvedValue({ totalQP: 0, eventsScored: 0 }), diff --git a/app/services/match-sync/__tests__/sync-tennis-rescore.test.ts b/app/services/match-sync/__tests__/sync-tennis-rescore.test.ts index 6b73b7f..19b1216 100644 --- a/app/services/match-sync/__tests__/sync-tennis-rescore.test.ts +++ b/app/services/match-sync/__tests__/sync-tennis-rescore.test.ts @@ -1,4 +1,5 @@ import { describe, it, expect, vi, beforeEach } from "vitest"; +import type * as QualifyingPointsModule from "~/models/qualifying-points"; // The helper under test re-derives QP via processQualifyingBracketEvent and // recalculates dropped participants — both stubbed so the test drives the @@ -13,7 +14,7 @@ vi.mock("~/models/scoring-calculator", () => ({ // Keep the real diffChangedQualifyingPoints (the change-detection primitive under // test here); only stub the dropped-participant total recalc. vi.mock("~/models/qualifying-points", async (importActual) => { - const actual = await importActual(); + const actual = await importActual(); return { ...actual, recalculateParticipantQP: vi.fn().mockResolvedValue(undefined), @@ -69,7 +70,7 @@ describe("rescoreTennisBracketAndDetectChanges", () => { const changed = await rescoreTennisBracketAndDetectChanges(EVENT_ID, SPORTS_SEASON_ID, db as never); - expect([...changed].sort()).toEqual(["B", "C"]); + expect([...changed].toSorted()).toEqual(["B", "C"]); expect(processQualifyingBracketEvent).toHaveBeenCalledWith(EVENT_ID, db); // No participant dropped out, so no manual total recalc. expect(recalculateParticipantQP).not.toHaveBeenCalled();