openpencil/tests/e2e/toolbar/hud.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

19 lines
732 B
TypeScript

import { expect, test } from '@playwright/test'
import { CanvasHelper } from '#tests/helpers/canvas'
test('mobile file menu opens with the keyboard and returns focus on Escape', async ({ page }) => {
await page.setViewportSize({ width: 390, height: 844 })
await page.goto('/?test')
const canvas = new CanvasHelper(page)
await canvas.waitForInit()
const trigger = page.getByRole('button', { name: 'File', exact: true })
await trigger.focus()
await trigger.press('Enter')
await expect(page.getByRole('menuitem', { name: 'New', exact: true })).toBeVisible()
await page.keyboard.press('Escape')
await expect(trigger).toBeFocused()
await expect(page.getByRole('menu')).toHaveCount(0)
canvas.assertNoErrors()
})