BS-004 Build approved homepage composition with explicit asset placeholders
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user