Files
orca/tests/e2e/helpers/paired-client-window-reveal.unit.test.ts
Jinjing 113f55c5f2 test(e2e): extract paired client window reveal into helper (#15991)
* test(e2e): extract paired client window reveal into helper

Paired clients launch hidden, parking runtime subscriptions. Playwright-driven
clients must be revealed to test actual user interactions. Extract the reveal
logic into a reusable helper with error handling and unit tests.

* test(e2e): handle crash dialogs and isolate collision fixture IDs

- Recover from recoverable UI error dialogs in selectRuntimeHost
- Give the same-ID collision fixture unique repo and worktree IDs to avoid
  reusing the runtime repo's ID, preventing fixture leakage
- Simplify verbose comments for clarity
2026-08-22 16:08:21 -07:00

45 lines
1.1 KiB
TypeScript

import { describe, expect, it } from 'vitest'
import { assertPairedClientWindowRevealed } from './paired-client-window-reveal'
describe('assertPairedClientWindowRevealed', () => {
it('accepts a window that the reveal made visible', () => {
expect(() =>
assertPairedClientWindowRevealed({
isVisible: true,
wasVisible: false,
windowCount: 1
})
).not.toThrow()
})
it('accepts a window that was already visible', () => {
expect(() =>
assertPairedClientWindowRevealed({
isVisible: true,
wasVisible: true,
windowCount: 1
})
).not.toThrow()
})
it('rejects a client with no window instead of letting the spec time out on a click', () => {
expect(() =>
assertPairedClientWindowRevealed({
isVisible: false,
wasVisible: false,
windowCount: 0
})
).toThrow(/no BrowserWindow/)
})
it('rejects a window that stays hidden after show()', () => {
expect(() =>
assertPairedClientWindowRevealed({
isVisible: false,
wasVisible: false,
windowCount: 2
})
).toThrow(/stayed hidden after show\(\)/)
})
})