diff --git a/apps/api/test/sports.test.ts b/apps/api/test/sports.test.ts index ad7be37..22c69c3 100644 --- a/apps/api/test/sports.test.ts +++ b/apps/api/test/sports.test.ts @@ -308,6 +308,11 @@ const fakeSites = (state: { benfica: { shirtNumber: number; name: string; photos }, ]); if (u.pathname.includes("/calendar/")) return json([]); + // EHF club competitions: the season pages exist but list no matches yet. + if (u.host.endsWith(".eurohandball.com")) { + if (u.pathname.endsWith("/matches/")) return bytes(Buffer.from(`
`, "utf8")); + if (u.pathname.startsWith("/umbraco/api/competitionmatchesapi/")) return json({ matches: [], hasPastMatches: false, hasFutureMatches: false }); + } if (u.host === "www.ligaportugal.pt" && u.pathname.endsWith(".png")) return { ok: true, status: 200, json: async () => ({}), text: async () => "", arrayBuffer: async () => state.png.buffer.slice(state.png.byteOffset, state.png.byteOffset + state.png.byteLength) as ArrayBuffer }; return { ok: false, status: 404, json: async () => ({}), text: async () => "", arrayBuffer: async () => new ArrayBuffer(0) }; @@ -352,6 +357,12 @@ describe("sports data service", () => { expect(comps.map((c) => [c.provider, c.externalId, c.season])).toEqual([ ["LIGA", "allianzcup", "20262027"], ["FPA", "PO09", "20262027"], + ["EHF", "cl-men", "20262027"], + ["EHF", "cl-women", "20262027"], + ["EHF", "ec-men", "20262027"], + ["EHF", "ec-women", "20262027"], + ["EHF", "el-men", "20262027"], + ["EHF", "el-women", "20262027"], ["LIGA", "ligaportugalbetclic", "20262027"], ["LIGA", "ligaportugalmeusuper", "20262027"], ["UEFA", "1", "20262027"], diff --git a/apps/app/src/App.test.tsx b/apps/app/src/App.test.tsx index fd43411..796e981 100644 --- a/apps/app/src/App.test.tsx +++ b/apps/app/src/App.test.tsx @@ -5,7 +5,7 @@ import userEvent from "@testing-library/user-event"; import { describe, expect, it, vi } from "vitest"; import { App } from "./App.js"; -vi.mock("./library/realtime.js", () => ({ useLibraryLive: () => "live" })); +vi.mock("./library/realtime.js", () => ({ useLibraryLive: () => "live", onSocketLive: () => () => {} })); const ME: Me = { user: { id: "u1", email: "ana@photoreport.pt", name: "Ana", locale: "pt-PT" }, diff --git a/apps/app/src/library/LocalFtp.test.tsx b/apps/app/src/library/LocalFtp.test.tsx index 68413cc..cd362ba 100644 --- a/apps/app/src/library/LocalFtp.test.tsx +++ b/apps/app/src/library/LocalFtp.test.tsx @@ -5,6 +5,10 @@ import { type FtpStatus, type IncomingFile, type Invoke, useLocalFtp } from "./L import type { UploadStatus } from "./uploads.js"; import { localPhotos } from "../offline/local.js"; +// The feed sends through the signed-in client (offline queue flush, local autopilot). Nothing here signs in, and +// the target has no organization, so a bare client is enough. +vi.mock("../auth.js", () => ({ useAuth: () => ({ api: {} }) })); + const status = (running: boolean): FtpStatus => ({ running, settings: { port: 2121, users: [{ name: "1dx", password: "1dx" }], ingest: "~/Desktop/ingest", workFolder: "~/Desktop/{year}/{date} - {event}", autoStart: false, uploadOriginals: false },