fix e2e create menu races

This commit is contained in:
Jinjing
2026-09-07 19:29:41 -07:00
parent ccad9f63a8
commit c8d4528e12
2 changed files with 4 additions and 2 deletions
@@ -49,7 +49,9 @@ function SidebarCreateMenu({
// Why: the tour highlights this trigger, so the handoff has to fire from the
// menu item rather than the button that now only opens the menu.
const handleCreateWorkspace = useCallback(() => {
openWorkspaceCreationComposerWithTourHandoff()
// Why: opening after Radix tears down the menu prevents its focus restoration
// from treating the new dialog as an outside interaction.
window.setTimeout(openWorkspaceCreationComposerWithTourHandoff, 0)
}, [])
return (
+1 -1
View File
@@ -459,7 +459,7 @@ test.describe('Create Workspace', () => {
// portaled outside the dialog element, so locate it page-wide.
const suggestion = orcaPage.getByRole('option', { name: linkedWorkspacePattern })
await expect(suggestion).toBeVisible()
await suggestion.click()
await orcaPage.keyboard.press('Enter')
const createButton = dialog.getByRole('button', { name: /Create (Workspace|Worktree)/i })
await expect(createButton).toBeEnabled()