mirror of
https://github.com/stablyai/orca.git
synced 2026-11-03 02:27:43 +00:00
test: tighten transport, recovery, and diagnostic checks (#33559)
* test: tighten transport, recovery, and diagnostic checks * test: use at for last mock socket access --------- Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
This commit is contained in:
@@ -16,11 +16,11 @@ describe('withSelectedTabs', () => {
|
||||
|
||||
it('keeps a selection the move did not touch', () => {
|
||||
const before = [
|
||||
{ id: 'g1', activeTabId: 'a', tabOrder: ['a', 'b'] },
|
||||
{ id: 'g1', activeTabId: 'a', tabOrder: ['d', 'a', 'b'] },
|
||||
{ id: 'g2', activeTabId: 'c', tabOrder: ['c'] }
|
||||
]
|
||||
const after = [
|
||||
{ id: 'g1', tabOrder: ['a'] },
|
||||
{ id: 'g1', tabOrder: ['d', 'a'] },
|
||||
{ id: 'g2', tabOrder: ['b', 'c'] }
|
||||
]
|
||||
expect(withSelectedTabs(before, after, 'b').map((group) => group.activeTabId)).toEqual([
|
||||
|
||||
@@ -17,6 +17,7 @@ const { OrcaRuntimeService } = await import('./orca-runtime-test-mocks.spec')
|
||||
await import('./orca-runtime-test-lifecycle.spec')
|
||||
const {
|
||||
HEADLESS_LEAF_ID,
|
||||
makeDeferred,
|
||||
TEST_WORKTREE_ID,
|
||||
makeRuntimeStoreWithWorkspaceSession,
|
||||
makeWorkspaceSessionWithHeadlessTerminal
|
||||
@@ -80,7 +81,22 @@ describe("a paired desktop's Reopen of a held pane (layout-owner build)", () =>
|
||||
const { runtime, spawn } = await heldPaneRuntime()
|
||||
expect(publishedStatus(runtime)).toBe('held')
|
||||
|
||||
await expect(runtime.reopenHeldTerminalPanes([PANE])).resolves.toEqual({ reopened: true })
|
||||
const stopStarted = makeDeferred()
|
||||
const stopFinished = makeDeferred()
|
||||
daemonHold.reopen.mockImplementationOnce(async () => {
|
||||
stopStarted.resolve()
|
||||
await stopFinished.promise
|
||||
return { reopened: true }
|
||||
})
|
||||
const reopening = runtime.reopenHeldTerminalPanes([PANE])
|
||||
await stopStarted.promise
|
||||
try {
|
||||
expect(spawn).toHaveBeenCalledOnce()
|
||||
expect(publishedStatus(runtime)).toBe('held')
|
||||
} finally {
|
||||
stopFinished.resolve()
|
||||
}
|
||||
await expect(reopening).resolves.toEqual({ reopened: true })
|
||||
|
||||
expect(daemonHold.reopen).toHaveBeenCalledOnce()
|
||||
expect(spawn).toHaveBeenCalledTimes(2)
|
||||
|
||||
Reference in New Issue
Block a user