Sources test: pin which medicine source links show, not just how many

Merged
BI
1mo ago
+18-1

User description

Summary

  • Before: the source-catalogue test checked only that the medicine pages show three source links. A wrong link could replace a right one and the test would still pass.
  • After: the test names each link. The clozapine page shows the WA clozapine guideline, and the lithium page shows the Australian Prescriber lithium article and its correction.
  • This is the follow-up promised on #3562 (Qodo finding on tests/source-catalogue-providers.test.ts:219). It is test-only, so nothing a reader sees changes.

Areas touched: Clinical reference content

Verification

  • Checks run: npx vitest run tests/source-catalogue-providers.test.ts gave "Tests 13 passed (13)". eslint on the file was clean, and tsc --noEmit reported 0 errors.

Risk and rollout

  • Risk: none to the live site. Test only.
  • Rollback: revert the commit.
  • Provider or production effects: None.

Notes

  • I'm not restoring the "corrected 12 June 2020" metadata on the older ps-diff-src-au-ausprescr-lithium-2020 record, though I flagged it on #3562. Putting it back makes check:source-acquisitions fail. That record shares its URL with the adopted lithium article, and the mismatched metadata drops that article to D band. The correction is already its own adopted record, so nothing is lost.

🤖 Generated with Claude Code

https://claude.ai/code/session_01F8eTG5dvhsjc2x2ZYnY4YT


Generated by Claude Code


Summary by cubic

Pins the source-catalogue test to the exact medicine source links, so a wrong link can no longer replace a right one and still pass.

  • Before, the test only checked that three source links appear on the medicine pages.
  • Now it asserts the WA clozapine guideline on the clozapine page and the Australian Prescriber lithium article plus its correction on the lithium page.
  • Test-only change; nothing a reader sees changes. The merge from main adds no test or content changes.

CodeAnt-AI Description

Verify exact medicine source links in catalogue tests

What Changed

  • The source-catalogue test now checks the exact clozapine guideline and the lithium article and correction, rather than only checking the number of links.

Impact

✅ Catches incorrect or swapped medicine source links
✅ Confirms the expected clozapine and lithium references

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.