Skip to content

Commit b1a63bb

Browse files
committed
Add a test with playwright for #10688
1 parent 46cdcc3 commit b1a63bb

File tree

3 files changed

+57
-2
lines changed

3 files changed

+57
-2
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
title: Links to nested elements works
3+
format: revealjs
4+
---
5+
6+
## Quarto Figure
7+
8+
![Elephant](https://quarto.org/docs/authoring/images/crossref-figure.png){#fig-elephant}
9+
10+
## Link to the figure
11+
12+
See [Figure Element](#fig-elephant)
13+
14+
## Image
15+
16+
![Elephant](https://quarto.org/docs/authoring/images/crossref-figure.png){#elephant}
17+
18+
## Link to the image
19+
20+
See [Figure Element](#elephant)
21+
22+
## Equation
23+
24+
$$
25+
\begin{aligned}
26+
f(X) = y.
27+
\end{aligned}
28+
$$ {#eq-EEE}
29+
30+
## Link to equation
31+
32+
See @eq-EEE.
33+
34+
## Theorem
35+
36+
::: {#thm-TTT}
37+
Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint consectetur cupidatat.
38+
:::
39+
40+
## Link to theorem
41+
42+
See @thm-TTT.

tests/docs/smoke-all/2024/09/02/10657.qmd

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ _quarto:
1717
- []
1818
---
1919

20-
<!-- TODO: Add test with puppeteer about link working -->
21-
2220
## Quarto Figure
2321

2422
![Elephant](https://quarto.org/docs/authoring/images/crossref-figure.png){#fig-elephant}

tests/integration/playwright/tests/revealjs.spec.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,19 @@ test('logo and footer are correctly shown', async ({ page }) => {
1414
await expect(page.locator('.reveal > .footer.footer-default')).toBeHidden();
1515
await expect(page.locator('.reveal > .footer:not(.footer-default)')).toContainText('A different footer');
1616
await expect(page.locator('.slide-logo')).toHaveAttribute("src", "quarto.png");
17+
});
18+
19+
test('internal id for links between slides are working', async ({ page }) => {
20+
await page.goto('./revealjs/links-id.html#/link-to-the-figure');
21+
await page.getByRole('link', { name: 'Figure Element' }).click();
22+
await page.waitForURL(/quarto-figure$/);
23+
await page.goto('./revealjs/links-id.html#/link-to-the-image');
24+
await page.getByRole('link', { name: 'Figure Element' }).click();
25+
await page.waitForURL(/image$/);
26+
await page.goto('./revealjs/links-id.html#/link-to-equation');
27+
await page.getByRole('link', { name: 'Equation' }).click();
28+
await page.waitForURL(/equation$/);
29+
await page.goto('./revealjs/links-id.html#/link-to-theorem');
30+
await page.getByRole('link', { name: 'Theorem' }).click();
31+
await page.waitForURL(/theorem$/);
1732
});

0 commit comments

Comments
 (0)