@@ -323,6 +323,8 @@ test.describe('quick chat window', () => {
323323
324324 await test . step ( 'a settings file without the setting keeps the ⌥Space it always had' , async ( ) => {
325325 const existing = await desktop . launch ( { origin : fixture . origin , settings : settings ( ) } )
326+ // Main-process evaluates race startup until the first window exists.
327+ await existing . app . firstWindow ( )
326328 await expect . poll ( ( ) => isRegistered ( existing . app , 'Alt+Space' ) ) . toBe ( true )
327329 await expect . poll ( ( ) => storedShortcut ( existing . userData ) ) . toBe ( 'Alt+Space' )
328330 await desktop . close ( existing )
@@ -331,6 +333,7 @@ test.describe('quick chat window', () => {
331333 const fresh =
332334 await test . step ( 'a first run binds nothing and records that it is off' , async ( ) => {
333335 const launched = await desktop . launch ( { origin : fixture . origin } )
336+ await launched . app . firstWindow ( )
334337 await expect . poll ( ( ) => startupBound ( launched . app ) ) . toBe ( true )
335338 expect ( await isRegistered ( launched . app , 'Alt+Space' ) ) . toBe ( false )
336339 await expect . poll ( ( ) => storedShortcut ( launched . userData ) ) . toBeNull ( )
@@ -340,6 +343,7 @@ test.describe('quick chat window', () => {
340343
341344 await test . step ( 'relaunching that profile still binds nothing' , async ( ) => {
342345 const relaunched = await desktop . launch ( { origin : fixture . origin , userData : fresh . userData } )
346+ await relaunched . app . firstWindow ( )
343347 await expect . poll ( ( ) => startupBound ( relaunched . app ) ) . toBe ( true )
344348 expect ( await isRegistered ( relaunched . app , 'Alt+Space' ) ) . toBe ( false )
345349 expect ( storedShortcut ( relaunched . userData ) ) . toBeNull ( )
0 commit comments