Skip to content

Commit c568bd8

Browse files
committed
✅(frontend) add e2e test for onboarding modal
Ensure onboarding entrypoint and modal navigation work end-to-end.
1 parent 646716a commit c568bd8

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { expect, test } from '@playwright/test';
2+
3+
test.describe('Onboarding modal', () => {
4+
test.beforeEach(async ({ page }) => {
5+
await page.goto('/');
6+
await expect(page.getByTestId('left-panel-desktop')).toBeVisible();
7+
});
8+
9+
test('opens onboarding modal from help menu and can navigate/close', async ({
10+
page,
11+
}) => {
12+
await page.getByRole('button', { name: 'Open onboarding menu' }).click();
13+
14+
await page.getByRole('menuitem', { name: 'Onboarding' }).click();
15+
16+
const modal = page.getByTestId('onboarding-modal');
17+
await expect(modal).toBeVisible();
18+
19+
await expect(page.getByTestId('onboarding-step-0')).toHaveAttribute(
20+
'tabindex',
21+
'0',
22+
);
23+
24+
// Go to next step and ensure step focusable state updates
25+
await page.getByTestId('onboarding-next').click();
26+
await expect(page.getByTestId('onboarding-step-1')).toHaveAttribute(
27+
'tabindex',
28+
'0',
29+
);
30+
31+
// Close the modal using Escape (works regardless of close button label)
32+
await page.keyboard.press('Escape');
33+
await expect(modal).toBeHidden();
34+
});
35+
});

0 commit comments

Comments
 (0)