fix: correct Year 2 prerequisite links

This commit is contained in:
msa46 2026-08-02 16:41:31 +02:00
parent 7ade5e4061
commit 4828a327d7
3 changed files with 21 additions and 2 deletions

View file

@ -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

View file

@ -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

View file

@ -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('/', '\\/')}\\)`));
});
}