-
Notifications
You must be signed in to change notification settings - Fork 433
Expand file tree
/
Copy pathhtml-dark-mode-nojs.spec.ts
More file actions
56 lines (46 loc) · 2.79 KB
/
html-dark-mode-nojs.spec.ts
File metadata and controls
56 lines (46 loc) · 2.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import { test, expect } from '@playwright/test';
test.use({ javaScriptEnabled: false });
test('Dark brand default, no JS', async ({ page }) => {
// This document use a custom theme file that change the background color of the title banner
// Same user defined color should be used in both dark and light theme
await page.goto('./html/dark-brand/brand-after-theme.html');
const locatr = await page.locator('body').first();
await expect(locatr).toHaveClass('fullcontent quarto-dark');
await expect(locatr).toHaveCSS('background-color', 'rgb(66, 7, 11)');
});
test('Light brand default, no JS', async ({ page }) => {
// This document use a custom theme file that change the background color of the title banner
// Same user defined color should be used in both dark and light theme
await page.goto('./html/dark-brand/brand-before-theme.html');
const locatr = await page.locator('body').first();
await expect(locatr).toHaveClass('fullcontent quarto-light');
await expect(locatr).toHaveCSS('background-color', 'rgb(252, 252, 252)');
});
test('Syntax highlighting, a11y, no JS', async ({ page }) => {
// This document use a custom theme file that change the background color of the title banner
// Same user defined color should be used in both dark and light theme
await page.goto('./html/dark-brand/syntax-highlighting/a11y-syntax-highlighting.html');
const locatr = await page.locator('body').first();
await expect(locatr).toHaveClass('fullcontent quarto-light');
await expect(locatr).toHaveCSS('background-color', 'rgb(255, 255, 255)');
const importKeyword = await page.locator('span.im').first();
await expect(importKeyword).toHaveCSS('color', 'rgb(84, 84, 84)');
});
test('Syntax highlighting, arrow, no JS', async ({ page }) => {
// This document use a custom theme file that change the background color of the title banner
// Same user defined color should be used in both dark and light theme
await page.goto('./html/dark-brand/syntax-highlighting/arrow-syntax-highlighting.html');
const locatr = await page.locator('body').first();
await expect(locatr).toHaveClass('fullcontent quarto-light');
await expect(locatr).toHaveCSS('background-color', 'rgb(255, 255, 255)');
const link = await page.locator('span.al').first();
await expect(link).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)');
});
test('Project dark brand default, no JS', async ({ page }) => {
// This document use a custom theme file that change the background color of the title banner
// Same user defined color should be used in both dark and light theme
await page.goto('./html/dark-brand/project-dark/simple.html');
const locatr = await page.locator('body').first();
await expect(locatr).toHaveClass('fullcontent quarto-dark');
await expect(locatr).toHaveCSS('background-color', 'rgb(66, 7, 11)');
});