openpencil/tests/e2e/tools/section.spec.ts
Danila Poyarkov c3f5189f8f style: tighten import grouping
- Configure oxfmt custom import groups for workspace, app, package, and test aliases
- Keep type imports grouped with their matching source category instead of one global tail group
- Expand the format script to cover formatter config, Vite files, and scripts
2026-05-06 02:22:08 +03:00

41 lines
1,022 B
TypeScript

import { expect, test, type Page } from '@playwright/test'
import { CanvasHelper } from '#tests/helpers/canvas'
let page: Page
let canvas: CanvasHelper
test.describe.configure({ mode: 'serial' })
test.beforeAll(async ({ browser }) => {
page = await browser.newPage()
await page.goto('/?test')
canvas = new CanvasHelper(page)
await canvas.waitForInit()
})
test.afterAll(async () => {
await page.close()
})
test.beforeEach(async () => {
await canvas.clearCanvas()
})
test('draw section in full editor without browser errors', async () => {
await canvas.drawSection(100, 100, 240, 160)
await expect(page.locator('[data-test-id="design-node-header"]')).toContainText('SECTION')
await expect
.poll(async () => {
return page.evaluate(() => {
const store = window.__OPEN_PENCIL_STORE__
const selectedId = [...store.state.selectedIds][0]
return selectedId ? store.graph.getNode(selectedId)?.type : null
})
})
.toBe('SECTION')
canvas.assertNoErrors()
})