test(ui): qualify denser dashboard discovery and offer date states

This commit is contained in:
cesnimda
2026-11-04 07:06:46 +01:00
parent a7d726738b
commit 79d7bbe0a1
199 changed files with 6239 additions and 11 deletions
@@ -52,10 +52,13 @@ try {
return route.fulfill({ status: Object.hasOwn(fixtures, url.pathname) ? 200 : 404, contentType: 'application/json', body: JSON.stringify(fixtures[url.pathname] ?? {}) });
});
const scan = async state => {
if (width < 768 && state !== 'initial') {
await filters.getByRole('button', { name: language === 'en' ? 'Jump to results' : 'Gå til resultater', exact: true }).click();
assert.equal(await results.evaluate(node => node === document.activeElement), true);
} else await page.evaluate(() => window.scrollTo(0, 0));
assert.equal(await page.evaluate(() => document.documentElement.scrollWidth > innerWidth + 1), false);
const result = await new AxeBuilder({ page }).withTags(['wcag2a', 'wcag2aa', 'wcag21aa', 'wcag22aa']).analyze();
report.screens.push({ width, language, mode, state, violations: result.violations }); assert.deepEqual(result.violations, []);
await page.evaluate(() => window.scrollTo(0, 0));
await page.screenshot({ path: path.join(out, `${state}-${language}-${mode}-${width}.png`), fullPage: width >= 768 });
};
await page.goto('http://localhost:4338/discover');