Skip to content

Commit 31104a7

Browse files
playwright tests before fixing #8568
i simply report i do not try to explain but it looks like a11y has a dark mode inline code foreground color
1 parent 908cde5 commit 31104a7

File tree

3 files changed

+32
-4
lines changed

3 files changed

+32
-4
lines changed

tests/docs/playwright/html/dark-brand/syntax-highlighting/a11y-syntax-highlighting.qmd

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,17 @@ theme:
99
highlight-style: a11y
1010
---
1111

12+
### Inline code
13+
14+
* Python: `def identity(x): return x`{.python}
15+
* R: `identity <- function(x) x`{.r}
16+
17+
### Code blocks
1218

1319
```markdown
1420
![asdf](asd.png)
1521
```
1622

17-
1823
```python
1924
#| label: fig-polar
2025
#| fig-cap: "A line plot on a polar axis"

tests/docs/playwright/html/dark-brand/syntax-highlighting/arrow-syntax-highlighting.qmd

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@ _quarto:
1212
- ["link[href*=\"-dark-\"]"]
1313
---
1414

15-
## Hello
15+
### Inline code
16+
17+
* Python: `def identity(x): return x`{.python}
18+
* R: `identity <- function(x) x`{.r}
19+
20+
### Code blocks
1621

1722
```markdown
1823
![asdf](asd.png)
1924
```
2025

21-
2226
```python
2327
#| label: fig-polar
2428
#| fig-cap: "A line plot on a polar axis"

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

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,18 @@ test('Syntax highlighting, a11y, with JS', async ({ page }) => {
4343
await expect(locatr).toHaveClass('fullcontent quarto-light');
4444
await expect(locatr).toHaveCSS('background-color', 'rgb(255, 255, 255)');
4545
const importKeyword = await page.locator('span.im').first();
46+
// light inline code
47+
const pythonCode = await page.locator('li code.sourceCode.r');
48+
await expect(pythonCode).toHaveCSS('background-color', 'rgb(248, 249, 250)');
49+
await expect(pythonCode).toHaveCSS('color', 'rgb(125, 18, 186)');
4650
// light highlight stylesheet
4751
await expect(importKeyword).toHaveCSS('color', 'rgb(84, 84, 84)');
52+
4853
await page.locator("a.quarto-color-scheme-toggle").click();
54+
55+
// dark inline code
56+
await expect(pythonCode).toHaveCSS('background-color', 'rgb(248, 249, 250)');
57+
await expect(pythonCode).toHaveCSS('color', 'rgb(192, 128, 216)');
4958
// dark highlight stylesheet
5059
await expect(importKeyword).toHaveCSS('color', 'rgb(248, 248, 242)');
5160
});
@@ -58,6 +67,16 @@ test('Syntax highlighting, arrow, with JS', async ({ page }) => {
5867
const locatr = await page.locator('body').first();
5968
await expect(locatr).toHaveClass('fullcontent quarto-light');
6069
await expect(locatr).toHaveCSS('background-color', 'rgb(255, 255, 255)');
70+
// light inline code
71+
const pythonCode = await page.locator('li code.sourceCode.python');
72+
await expect(pythonCode).toHaveCSS('background-color', 'rgb(248, 249, 250)');
73+
await expect(pythonCode).toHaveCSS('color', 'rgb(125, 18, 186)');
74+
// alert
6175
const link = await page.locator('span.al').first();
62-
await expect(link).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)');
76+
await expect(link).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)'); // transparent
77+
78+
await page.locator("a.quarto-color-scheme-toggle").click();
79+
// dark inline code
80+
await expect(pythonCode).toHaveCSS('background-color', 'rgb(248, 249, 250)');
81+
await expect(pythonCode).toHaveCSS('color', 'rgb(125, 18, 186)');
6382
});

0 commit comments

Comments
 (0)