Skip to content

Commit 1591f5b

Browse files
dark brand no-js tests
1 parent 59c5f14 commit 1591f5b

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/integration/playwright/tests/html-dark-mode.spec.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,24 @@ test('Dark and light brand before user themes', async ({ page }) => {
2525
const locatr2 = await page.locator('body').first();
2626
await expect(locatr2).toHaveCSS('background-color', 'rgb(6, 6, 6)');
2727
});
28+
29+
test.use({ javaScriptEnabled: false });
30+
31+
test('Dark brand default, no JS', async ({ page }) => {
32+
// This document use a custom theme file that change the background color of the title banner
33+
// Same user defined color should be used in both dark and light theme
34+
await page.goto('./html/dark-brand/brand-after-theme.html');
35+
const locatr = await page.locator('body').first();
36+
await expect(locatr).toHaveClass('fullcontent quarto-dark');
37+
await expect(locatr).toHaveCSS('background-color', 'rgb(66, 7, 11)');
38+
});
39+
40+
41+
test('Light brand default, no JS', async ({ page }) => {
42+
// This document use a custom theme file that change the background color of the title banner
43+
// Same user defined color should be used in both dark and light theme
44+
await page.goto('./html/dark-brand/brand-before-theme.html');
45+
const locatr = await page.locator('body').first();
46+
await expect(locatr).toHaveClass('fullcontent quarto-light');
47+
await expect(locatr).toHaveCSS('background-color', 'rgb(252, 252, 252)');
48+
});

0 commit comments

Comments
 (0)