openpencil/tests/e2e/settings/tabs.spec.ts
Danila Poyarkov e69ba75c12
refactor(ui): compose shared editor controls (#670)
* refactor(ui): extract shared action and navigation primitives

* refactor(ui): compose settings and libraries with shared tabs

* feat(ui): preserve native activation and toolbar keyboard navigation

* refactor(home): share document entries and accessible input controls

* fix(layers): share virtualized row geometry and selection styling

* refactor(layout): compose spacing and readable dimension controls

* refactor(properties): compose advanced strokes and inline effects

* refactor(ui): reuse actions in page and property controls

* refactor(settings): adopt shared actions without changing workflows

* refactor(ui): share collaboration and provider actions

* refactor(ui): finish shell and paint action composition

* test(ui): restore extracted control and settings coverage

* test(ui): complete workflow extraction coverage

* fix(ui): address review and trim redundant snapshots

* fix(layout): preserve single-step Undo for guides and wrap
2026-09-10 12:09:06 +03:00

34 lines
1.4 KiB
TypeScript

import { expect, test } from '@playwright/test'
import { CanvasHelper } from '#tests/helpers/canvas'
test('settings tabs associate panels and support vertical keyboard navigation', async ({
page
}) => {
await page.goto('/?test')
await new CanvasHelper(page).waitForInit()
await page.getByTestId('app-settings-trigger').click()
const dialog = page.getByTestId('app-settings-dialog')
const general = dialog.getByRole('tab', { name: 'General', exact: true })
await expect(general).toHaveAttribute('aria-selected', 'true')
await expect(dialog).toHaveScreenshot('settings-tabs-general.png')
await general.focus()
await general.press('ArrowDown')
const ai = page.getByTestId('settings-section-ai')
await expect(ai).toBeFocused()
await expect(ai).toHaveAttribute('aria-selected', 'true')
await expect(dialog.getByRole('tabpanel')).toHaveCount(1)
await expect(page.getByTestId('settings-ai-panel')).toBeVisible()
await expect(dialog.getByRole('tabpanel')).toHaveAttribute(
'aria-labelledby',
(await ai.getAttribute('id')) ?? ''
)
await ai.press('Home')
await expect(general).toBeFocused()
await expect(page.getByTestId('settings-general-panel')).toBeVisible()
await general.press('End')
await expect(page.getByTestId('settings-section-storage')).toBeFocused()
await page.getByTestId('app-settings-done').click()
await expect(dialog).not.toBeVisible()
})