From 26c386284c7f35af07c78b28bb6ccef0d56d09cd Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 16 Oct 2026 01:08:15 +0000 Subject: [PATCH] Sources test: pin which medicine source links show, not just how many The source-catalogue test only checked that three medicine source links exist, so a wrong link could swap in for a right one and still pass. It now names each link: the WA clozapine guideline on the clozapine page, and the Australian Prescriber lithium article and its correction on the lithium page. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01F8eTG5dvhsjc2x2ZYnY4YT --- tests/source-catalogue-providers.test.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/tests/source-catalogue-providers.test.ts b/tests/source-catalogue-providers.test.ts index cdecb9301c..03589de119 100644 --- a/tests/source-catalogue-providers.test.ts +++ b/tests/source-catalogue-providers.test.ts @@ -216,7 +216,24 @@ describe("repository source providers", () => { expect(medicationReferences.filter((reference) => reference.usage.field !== "sourceLinks")).toHaveLength( medicationSourceRows.length, ); - expect(medicationReferences.filter((reference) => reference.usage.field === "sourceLinks")).toHaveLength(3); + expect( + medicationReferences + .filter((reference) => reference.usage.field === "sourceLinks") + .map((reference) => [reference.usage.recordId, reference.canonicalUrl]), + ).toEqual([ + [ + "clozapine", + "https://www.health.wa.gov.au/~/media/Corp/Documents/Health-for/MTU/Guidelines-for-the-Safe-and-Quality-Use-of-Clozapine-Therapy-in-the-WA-health-system.pdf", + ], + [ + "lithium-carbonate-ir-sr", + "https://australianprescriber.tg.org.au/articles/lithium-therapy-and-its-interactions.html", + ], + [ + "lithium-carbonate-ir-sr", + "https://australianprescriber.tg.org.au/articles/lithium-therapy-and-its-interactions-correction.html", + ], + ]); const serviceReferences = provider("services").references(); const services = loadServicesSnapshot().services;