diff --git a/app/__tests__/metadata.test.ts b/app/__tests__/metadata.test.ts index 49a67fd..3ff2058 100644 --- a/app/__tests__/metadata.test.ts +++ b/app/__tests__/metadata.test.ts @@ -32,6 +32,19 @@ vi.mock("@/lib/db/schema", () => ({ gamePlatformSupport: { gameId: "gameId", hardwareSlug: "hardwareSlug", protonStatus: "protonStatus" }, user: { id: "id", name: "name", image: "image", role: "role" }, entryScreenshots: { id: "id", entryId: "entryId", storageKey: "storageKey", orderIndex: "orderIndex" }, + steamReviewSentimentEnum: { + enumValues: [ + "overwhelmingly_positive", + "very_positive", + "positive", + "mostly_positive", + "mixed", + "mostly_negative", + "negative", + "very_negative", + "overwhelmingly_negative", + ], + }, })) vi.mock("drizzle-orm", () => ({ @@ -43,18 +56,21 @@ vi.mock("drizzle-orm", () => ({ isNull: vi.fn((col: unknown) => col), inArray: vi.fn((col: unknown, vals: unknown) => ({ col, vals })), sql: vi.fn((strings: TemplateStringsArray, ...values: unknown[]) => ({ raw: strings, vals: values })), -})) - -vi.mock("@/lib/steam/sync", () => ({ - isSyncStale: vi.fn(() => false), - syncSteamGame: vi.fn(() => Promise.resolve()), + avg: vi.fn((col: unknown) => col), + count: vi.fn((col: unknown) => col), })) vi.mock("@/lib/storage", () => ({ getR2PublicUrl: vi.fn(() => "https://r2.example.com"), })) -vi.mock("@/lib/auth", () => ({})) +vi.mock("@/lib/auth", () => ({ + auth: { + $Infer: { Session: { user: {} } }, + api: {}, + handler: vi.fn(), + }, +})) vi.mock("@/lib/auth-client", () => ({})) vi.mock("@/lib/updates", () => ({ diff --git a/app/__tests__/sitemap.test.ts b/app/__tests__/sitemap.test.ts index 3a163ad..f5df060 100644 --- a/app/__tests__/sitemap.test.ts +++ b/app/__tests__/sitemap.test.ts @@ -32,13 +32,61 @@ vi.mock("@/lib/db/schema", () => ({ capsuleImage: "capsuleImage", syncStatus: "syncStatus", }, + gameVersions: { + id: "id", + gameId: "gameId", + versionString: "versionString", + buildId: "buildId", + }, + performanceEntries: { + id: "id", + versionId: "versionId", + isRemoved: "isRemoved", + hardwareSlug: "hardwareSlug", + fpsAvg: "fpsAvg", + fpsLow: "fpsLow", + fpsHigh: "fpsHigh", + }, hardware: { slug: "slug", createdAt: "createdAt" }, + gameComments: { gameId: "gameId", id: "id" }, + gamePlatformSupport: { + gameId: "gameId", + hardwareSlug: "hardwareSlug", + protonStatus: "protonStatus", + }, + user: { id: "id", name: "name", image: "image", role: "role" }, + entryScreenshots: { + id: "id", + entryId: "entryId", + storageKey: "storageKey", + orderIndex: "orderIndex", + }, + steamReviewSentimentEnum: { + enumValues: [ + "overwhelmingly_positive", + "very_positive", + "positive", + "mostly_positive", + "mixed", + "mostly_negative", + "negative", + "very_negative", + "overwhelmingly_negative", + ], + }, })) vi.mock("drizzle-orm", () => ({ + eq: vi.fn((col: unknown, val: unknown) => ({ col, val })), + and: vi.fn((...args: unknown[]) => args), + desc: vi.fn((col: unknown) => col), or: vi.fn((...args: unknown[]) => args[0]), ne: vi.fn((col: unknown) => col), isNull: vi.fn((col: unknown) => col), + inArray: vi.fn((col: unknown, vals: unknown) => ({ col, vals })), + sql: vi.fn((strings: TemplateStringsArray, ...values: unknown[]) => ({ raw: strings, vals: values })), + avg: vi.fn((col: unknown) => col), + count: vi.fn((col: unknown) => col), })) const mockGetAllUpdates = vi.fn(() => [])