12 lines
605 B
JavaScript
12 lines
605 B
JavaScript
import assert from 'node:assert/strict';
|
|
import { readFile } from 'node:fs/promises';
|
|
import test from 'node:test';
|
|
|
|
test('Sidebar override renders an accessible no-JavaScript programme switch', async () => {
|
|
const component = await readFile('src/components/ProgrammeSwitch.astro', 'utf8');
|
|
const wrapper = await readFile('src/components/Sidebar.astro', 'utf8');
|
|
assert.match(component, /aria-label="Bachelor programme"/);
|
|
assert.match(component, /aria-current/);
|
|
assert.doesNotMatch(component, /client:|<script/);
|
|
assert.match(wrapper, /@astrojs\/starlight\/components\/Sidebar\.astro/);
|
|
});
|