Fix multi-window merge test expectations

Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
brennanb2025
2026-06-22 21:08:05 -07:00
co-authored by Orca
parent 76f45456f6
commit d262bdfac1
2 changed files with 13 additions and 7 deletions
+1 -1
View File
@@ -482,7 +482,7 @@ describe('SSH IPC handlers', () => {
reconnectAttempt: 0,
remotePlatform: 'win32'
})
expect(mockWindow.webContents.send).toHaveBeenCalledWith('ssh:state-changed', {
expect(broadcastToMainWindowsMock).toHaveBeenCalledWith('ssh:state-changed', {
targetId: 'ssh-1',
state: {
targetId: 'ssh-1',
+12 -6
View File
@@ -14302,6 +14302,7 @@ describe('OrcaRuntimeService', () => {
terminalFitOverrideChanged: vi.fn(),
terminalDriverChanged: vi.fn()
})
const webContents = { send: vi.fn() }
const send = vi.fn((_channel: string, payload: { requestId: string }) => {
runtime.syncWindowGraph(1, {
tabs: [],
@@ -14329,7 +14330,7 @@ describe('OrcaRuntimeService', () => {
})
ipcMain.emit(
'terminal:tabCreateReply',
{},
{ sender: webContents },
{ requestId: payload.requestId, tabId: 'tab-renderer', title: 'Terminal' }
)
})
@@ -14337,8 +14338,9 @@ describe('OrcaRuntimeService', () => {
runtime.syncWindowGraph(1, { tabs: [], leaves: [] })
electronMocks.BrowserWindow.fromId.mockReturnValue({
isDestroyed: () => false,
webContents: { send }
webContents
})
webContents.send = send
const [first, second] = await Promise.all([
runtime.createMobileSessionTerminal(`id:${TEST_WORKTREE_ID}`, {
@@ -14394,12 +14396,13 @@ describe('OrcaRuntimeService', () => {
terminalFitOverrideChanged: vi.fn(),
terminalDriverChanged: vi.fn()
})
const webContents = { send: vi.fn() }
const send = vi.fn((_channel: string, payload: { requestId: string; worktreeId: string }) => {
const parentTabId =
payload.worktreeId === TEST_WORKTREE_ID ? 'tab-renderer-a' : 'tab-renderer-b'
ipcMain.emit(
'terminal:tabCreateReply',
{},
{ sender: webContents },
{ requestId: payload.requestId, tabId: parentTabId, title: 'Terminal' }
)
})
@@ -14407,8 +14410,9 @@ describe('OrcaRuntimeService', () => {
runtime.syncWindowGraph(1, { tabs: [], leaves: [] })
electronMocks.BrowserWindow.fromId.mockReturnValue({
isDestroyed: () => false,
webContents: { send }
webContents
})
webContents.send = send
const firstCreate = runtime.createMobileSessionTerminal(`id:${TEST_WORKTREE_ID}`, {
activate: false,
@@ -14498,10 +14502,11 @@ describe('OrcaRuntimeService', () => {
})
// Why: reply with a tabId but never sync a matching surface graph, so
// waitForMobileTerminalSurface times out and the rollback path runs.
const webContents = { send: vi.fn() }
const send = vi.fn((_channel: string, payload: { requestId: string }) => {
ipcMain.emit(
'terminal:tabCreateReply',
{},
{ sender: webContents },
{ requestId: payload.requestId, tabId: 'tab-ghost', title: 'Terminal' }
)
})
@@ -14509,8 +14514,9 @@ describe('OrcaRuntimeService', () => {
runtime.syncWindowGraph(1, { tabs: [], leaves: [] })
electronMocks.BrowserWindow.fromId.mockReturnValue({
isDestroyed: () => false,
webContents: { send }
webContents
})
webContents.send = send
const pending = runtime.createMobileSessionTerminal(`id:${TEST_WORKTREE_ID}`, {
activate: false