Replace Promise.resolve() with vi.waitFor in PTY claim test

Wait explicitly for the providerSpawn call to be made using vi.waitFor()
instead of relying on event-loop yielding. This makes the test more
deterministic and reduces flakiness from timing assumptions.
This commit is contained in:
Jinjing
2026-08-24 13:36:18 -07:00
parent 09e004fab3
commit e2e90ad226
@@ -505,9 +505,7 @@ describe('registerPtyHandlers', () => {
ORCA_WORKTREE_ID: 'repo-1::/tmp'
}
}) as Promise<{ id: string }>
await Promise.resolve()
expect(providerSpawn).toHaveBeenCalledTimes(1)
await vi.waitFor(() => expect(providerSpawn).toHaveBeenCalledTimes(1))
resolveSpawn({ id: 'pty-shared' })
await expect(Promise.all([runtimeSpawn, rendererSpawn])).resolves.toEqual([
{ id: 'pty-shared' },