BS-004 Build approved homepage composition with explicit asset placeholders

This commit is contained in:
rob
2026-11-10 14:17:14 +00:00
parent 2a4ffe1b00
commit 4f3b75b2b4
14 changed files with 290 additions and 98 deletions
+2 -1
View File
@@ -40,11 +40,12 @@ test('storage denied does not break initial page or theme toggle', async ({ page
})
for (const theme of ['dark', 'light']) {
test(`${theme} shell contrast and layout`, async ({ page }) => {
test(`${theme} shell contrast and layout`, async ({ page }, testInfo) => {
await page.addInitScript(theme => localStorage.setItem('bortstack-theme', theme), theme)
await page.goto('/')
expect((await new AxeBuilder({ page }).analyze()).violations).toEqual([])
expect(await page.locator('html').evaluate(el => el.scrollWidth <= el.clientWidth)).toBe(true)
await page.screenshot({ path: testInfo.outputPath(`homepage-${theme}.png`), fullPage: true })
await page.getByRole('button', { name: `Switch to ${theme === 'dark' ? 'light' : 'dark'} mode` }).focus()
await page.keyboard.press('Enter')
await expect(page.locator('html')).toHaveAttribute('data-bs-theme', theme === 'dark' ? 'light' : 'dark')