From 2c77135e7a184b3102db4e27b148614ad2e03dff Mon Sep 17 00:00:00 2001 From: spark Date: Wed, 21 Oct 2026 22:42:56 +0100 Subject: [PATCH] Let the sports test answer the EHF pages that refreshDue now reads 899b45f (#111) added the six EHF club competitions to the catalog and to refreshDue. The fake sites in test/sports.test.ts did not know *.eurohandball.com, so every EHF season page answered 404, refreshDue returned six errors and "reads the Liga and FPA, and only again after six hours" failed on main. The fake now serves an EHF season page with its ids and empty match lists, and the expected competitions include the six EHF ones (no fixtures yet). --- apps/api/test/sports.test.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) 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"],