Skip to content

Commit 8dbd586

Browse files
author
JP Wienekus
committed
add test
1 parent 66a7778 commit 8dbd586

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

packages/astro/e2e/dev-toolbar.test.js

+18-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,8 @@ test.describe('Dev Toolbar', () => {
241241

242242
const auditCanvas = toolbar.locator('astro-dev-toolbar-app-canvas[data-app-id="astro:audit"]');
243243
const auditHighlights = auditCanvas.locator('astro-dev-toolbar-highlight');
244-
for (const highlight of await auditHighlights.all()) {
244+
const highlights = (await auditHighlights.all()).filter((_, index) => index !== 1);
245+
for (const highlight of highlights) {
245246
await expect(highlight).toBeVisible();
246247
await highlight.hover();
247248
const tooltip = highlight.locator('astro-dev-toolbar-tooltip');
@@ -256,6 +257,22 @@ test.describe('Dev Toolbar', () => {
256257
}
257258
});
258259

260+
test('tooltip is rendered behind audit list window', async ({ page, astro }) => {
261+
await page.goto(astro.resolveUrl('/tooltip-position'));
262+
263+
const toolbar = page.locator('astro-dev-toolbar');
264+
const appButton = toolbar.locator('button[data-app-id="astro:audit"]');
265+
await appButton.click();
266+
267+
const auditCanvas = toolbar.locator('astro-dev-toolbar-app-canvas[data-app-id="astro:audit"]');
268+
const auditHighlights = auditCanvas.locator('astro-dev-toolbar-highlight');
269+
const highlight = auditHighlights.nth(1)
270+
271+
await expect(async() => {
272+
await highlight.hover({timeout: 100});
273+
}).rejects.toThrowError()
274+
});
275+
259276
test('can open Settings app', async ({ page, astro }) => {
260277
await page.goto(astro.resolveUrl('/'));
261278

packages/astro/e2e/fixtures/dev-toolbar/src/pages/tooltip-position.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<div>
66
<button role="top-left">Top left</button>
7-
<button role="button">Top right</button>
7+
<button role="top-right">Top right</button>
88
<button role="bottom-left">Bottom left</button>
99
<button role="bottom-right">Bottom right</button>
1010
</div>

0 commit comments

Comments
 (0)