Skip to content

Commit 1f62303

Browse files
committed
Add a test for creating tabsets using jupyter cell
1 parent 2c37a1f commit 1f62303

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
title: "mwe"
3+
---
4+
5+
## Quarto
6+
7+
From https://github.com/quarto-dev/quarto-cli/issues/1456
8+
9+
```{python}
10+
from IPython.display import display, Markdown
11+
import matplotlib.pyplot as plt
12+
```
13+
14+
::: {.panel-tabset}
15+
16+
```{python}
17+
#| output: asis
18+
for i in ["tab1 inside for loop", "tab2 inside for loop"]:
19+
display(Markdown(f"\n# {i}:\n"))
20+
fig = plt.figure()
21+
ax = fig.add_subplot(111)
22+
plt.show()
23+
```
24+
25+
:::
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { test, expect } from '@playwright/test';
2+
3+
test('Jupyter - Creates working tabsets from for loops', async ({ page }) => {
4+
await page.goto('/html/tabsets/jupyter-tabsets.html');
5+
const tab1 = page.getByRole('tab', { name: 'tab1 inside for loop:' });
6+
await expect(tab1).toHaveClass(/active/);
7+
const tabContent = page.locator('div.tab-content')
8+
await expect(tabContent).toBeVisible();
9+
const tab1Content = tabContent.locator('div.tab-pane').first();
10+
await expect(tab1Content).toHaveClass(/active/);
11+
await expect(tab1Content.locator('img')).toBeVisible();
12+
const tab2 = page.getByRole('tab', { name: 'tab2 inside for loop:' })
13+
await tab2.click();
14+
await expect(tab1).not.toHaveClass(/active/);
15+
await expect(tab1Content).not.toHaveClass(/active/);
16+
await expect(tab2).toHaveClass(/active/);
17+
const tab2Content = tabContent.locator('div.tab-pane').nth(1);
18+
await expect(tab2Content).toHaveClass(/active/);
19+
await expect(tab2Content.locator('img')).toBeVisible();
20+
});

0 commit comments

Comments
 (0)