From 4828a327d7f370644e6223a65538bfaf8bc7c728 Mon Sep 17 00:00:00 2001 From: msa46 Date: Sun, 2 Aug 2026 16:41:31 +0200 Subject: [PATCH] fix: correct Year 2 prerequisite links --- .../docs/bachelor/year-2/project-2-1.md | 2 +- .../docs/bachelor/year-2/project-2-2.md | 2 +- tests/content-audit.test.mjs | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/content/docs/bachelor/year-2/project-2-1.md b/src/content/docs/bachelor/year-2/project-2-1.md index 296440a..639cb0c 100644 --- a/src/content/docs/bachelor/year-2/project-2-1.md +++ b/src/content/docs/bachelor/year-2/project-2-1.md @@ -23,7 +23,7 @@ The project is accompanied by so-called skills classes. These classes help stude ## Prerequisites -A pass for [Project 1-1](../year-1/project-1-1/). Furthermore, a pass for at least two of the following three courses: +A pass for [Project 1-1](../../year-1/project-1-1/). Furthermore, a pass for at least two of the following three courses: - Introduction to Computer Science 1 - Introduction to Computer Science 2 diff --git a/src/content/docs/bachelor/year-2/project-2-2.md b/src/content/docs/bachelor/year-2/project-2-2.md index 8bc4bc3..07d496d 100644 --- a/src/content/docs/bachelor/year-2/project-2-2.md +++ b/src/content/docs/bachelor/year-2/project-2-2.md @@ -23,7 +23,7 @@ The project is accompanied by so-called skills classes. These classes help stude ## Prerequisites -A pass for [Project 1-2](../year-1/project-1-2/). Furthermore, a pass for at least two of the following three courses: +A pass for [Project 1-2](../../year-1/project-1-2/). Furthermore, a pass for at least two of the following three courses: - Introduction to Computer Science 1 - Introduction to Computer Science 2 diff --git a/tests/content-audit.test.mjs b/tests/content-audit.test.mjs index c0d5637..503d4ca 100644 --- a/tests/content-audit.test.mjs +++ b/tests/content-audit.test.mjs @@ -30,3 +30,22 @@ test('Year 2 honours programme retains its awaiting-content notice', async () => assert.match(content, /:::note\[Awaiting content\]/); assert.match(content, /This page is awaiting content\./); }); + +for (const { file, correctHref, shallowHref } of [ + { + file: 'src/content/docs/bachelor/year-2/project-2-1.md', + correctHref: '../../year-1/project-1-1/', + shallowHref: '../year-1/project-1-1/', + }, + { + file: 'src/content/docs/bachelor/year-2/project-2-2.md', + correctHref: '../../year-1/project-1-2/', + shallowHref: '../year-1/project-1-2/', + }, +]) { + test(`${file} links to its Year 1 prerequisite from the nested route`, async () => { + const content = await readFile(file, 'utf8'); + assert.match(content, new RegExp(`\\]\\(${correctHref.replaceAll('/', '\\/')}\\)`)); + assert.doesNotMatch(content, new RegExp(`\\]\\(${shallowHref.replaceAll('/', '\\/')}\\)`)); + }); +}