Skip to content

Commit 3b17628

Browse files
committed
test(desktop): disable focus emulation at native blur boundary
1 parent 03bca8b commit 3b17628

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎apps/desktop/e2e/chat-panel.spec.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,6 @@ test('chat panel sizes survive navigation, chat switches, collapse, and layout c
114114
const shell = app
115115
const page = await shell.firstWindow()
116116
const inputSession = await page.context().newCDPSession(page)
117-
// Playwright otherwise keeps the document focused when its native window loses focus.
118-
await inputSession.send('Emulation.setFocusEmulationEnabled', { enabled: false })
119117
page.on('pageerror', (error) => errors.push(error.message))
120118
page.on('crash', () => {
121119
rendererCrashed = true
@@ -270,6 +268,8 @@ test('chat panel sizes survive navigation, chat switches, collapse, and layout c
270268
await divider.evaluate((element) => element.releasePointerCapture(1))
271269
await page.mouse.move(rect.x + 100, rect.y + 100)
272270
} else if (interruption === 'blur') {
271+
// Reloads restore Playwright's focus emulation; native blur must reach the document.
272+
await inputSession.send('Emulation.setFocusEmulationEnabled', { enabled: false })
273273
await shell.evaluate(({ BrowserWindow }) => BrowserWindow.getAllWindows()[0].blur())
274274
await expect.poll(() => page.evaluate(() => document.hasFocus())).toBe(false)
275275
} else if (interruption === 'chat switch') {

0 commit comments

Comments
 (0)