Skip to content

Commit 20fd4c9

Browse files
committed
tests, playwright - Test that using katex does not conflict with crossref popup
1 parent 3b1d047 commit 20fd4c9

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
title: "Reproducible Quarto Document"
3+
format: html
4+
html-math-method: katex
5+
---
6+
7+
:::{#thm-with-math}
8+
### Theorem with math
9+
10+
Text with math $\mathcal P (\mathbb N) ≠ \varnothing$.
11+
:::
12+
13+
:::{#thm-without-math}
14+
### Theorem without math
15+
16+
Just text!
17+
:::
18+
19+
Reference to @thm-with-math. (Popup does not render correctly)
20+
21+
Reference to @thm-without-math. (Popup does render.)

tests/integration/playwright/tests/html-math-katex.spec.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,15 @@ test.describe('KaTeX math rendering in Jupyter engine document', () => {
1515
});
1616
}
1717
});
18+
19+
20+
test('KaTeX does not prevent crossref pop to be rendered', async ({ page }) => {
21+
await page.goto('html/math/katex/crossref-popup.html');
22+
const Thm1Ref = page.getByRole('link', { name: 'Theorem 1' });
23+
await expect(Thm1Ref).toBeVisible();
24+
await Thm1Ref.hover();
25+
// hover box should be visible
26+
await expect(page.getByRole('tooltip', { name: 'Theorem 1 (Theorem with math' })).toBeVisible();
27+
// Katex Math should be rendered in the hover box
28+
await expect(page.getByRole('tooltip', { name: 'Theorem 1 (Theorem with math' })).toContainText('∅');
29+
})

0 commit comments

Comments
 (0)