mirror of
https://github.com/stablyai/orca.git
synced 2026-10-17 00:03:08 +00:00
Fix multi-window merge test expectations
Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user