Skip to content

Commit 59753dc

Browse files
committed
test(e2e): assert the EMCN composer and menu anatomy in the mobile suite
The platform composer contains its scroll at every width, so desktop now asserts the same containment plus scrolling Home from beside the draft. A menu row's accessible name carries its drawn shortcut hint, so Auto layout is matched by its leading label.
1 parent 443684b commit 59753dc

1 file changed

Lines changed: 11 additions & 20 deletions

File tree

‎apps/sim/scripts/test-mobile-e2e.ts‎

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -785,23 +785,15 @@ async function exerciseViewport(
785785
await settle()
786786
const after = await heading.boundingBox()
787787
assert(after)
788-
if (compactNavigation(width)) {
789-
assert(
790-
Math.abs(after.y - before.y) <= 1,
791-
'Scrolling past a mobile draft must not move Home'
792-
)
793-
await page.mouse.move(width - 2, 300)
794-
await page.mouse.wheel(0, 600)
795-
await expect
796-
.poll(async () => (await heading.boundingBox())?.y ?? before.y)
797-
.toBeLessThan(before.y - 10)
798-
} else {
799-
await expect
800-
.poll(async () => (await heading.boundingBox())?.y ?? before.y, {
801-
message: 'Desktop scroll handoff must remain unchanged',
802-
})
803-
.toBeLessThan(before.y - 10)
804-
}
788+
// The composer contains its own scroll at every width; Home scrolls from outside it.
789+
assert(Math.abs(after.y - before.y) <= 1, 'Scrolling past a draft must not move Home')
790+
await page.mouse.move(width - 2, 300)
791+
await page.mouse.wheel(0, 600)
792+
await expect
793+
.poll(async () => (await heading.boundingBox())?.y ?? before.y, {
794+
message: 'Scrolling beside the draft must move Home',
795+
})
796+
.toBeLessThan(before.y - 10)
805797
await capture(page, `${browserName}-${width}-draft-scroll`)
806798
} finally {
807799
await composer.fill('')
@@ -1426,9 +1418,8 @@ async function exerciseViewport(
14261418
const bounds = await actions.boundingBox()
14271419
assert(bounds)
14281420
await page.touchscreen.tap(bounds.x + bounds.width / 2, bounds.y + bounds.height / 2)
1429-
await expect(
1430-
page.getByRole('menuitem', { name: 'Auto layout', exact: true })
1431-
).toBeVisible()
1421+
// The row's accessible name ends with its drawn shortcut hint (⇧L).
1422+
await expect(page.getByRole('menuitem', { name: /^Auto layout\b/ })).toBeVisible()
14321423
await page.keyboard.press('Escape')
14331424
} else {
14341425
const canvasBounds = await canvas.boundingBox()

0 commit comments

Comments
 (0)