mirror of
https://github.com/stablyai/orca.git
synced 2026-10-18 08:03:22 +00:00
fix(test): seed runtime host id for remote-reopen guard test
The prior test set settings.activeRuntimeEnvironmentId by spreading the store's settings, which widened workspaceDir to string|undefined and broke `pnpm typecheck` (GlobalSettings requires string). Seed the worktree with a `runtime:` hostId instead — getRuntimeEnvironmentIdForWorktree reads it directly, so no settings spread is needed.
This commit is contained in:
@@ -133,17 +133,21 @@ describe('reopenClosedTerminalTab', () => {
|
||||
})
|
||||
|
||||
it('skips local reopen on a remote-runtime worktree (host owns the terminal)', () => {
|
||||
const store = makeSeededStore()
|
||||
const tab = store
|
||||
.getState()
|
||||
.createTab(WT, undefined, undefined, { startupCwd: '/path/wt1/api' })
|
||||
store.getState().closeTab(tab.id)
|
||||
expect(store.getState().recentlyClosedTerminalTabsByWorktree[WT]).toHaveLength(1)
|
||||
|
||||
// Why: an active runtime environment makes the worktree host-owned; a local
|
||||
// createTab would leave an unbacked phantom tab, so reopen must bail.
|
||||
// Why: a `runtime:` host id makes the worktree host-owned; a local createTab
|
||||
// would leave an unbacked phantom tab, so reopen must bail and let the
|
||||
// cross-type dispatcher fall through to browser/editor.
|
||||
const store = createTestStore()
|
||||
seedStore(store, {
|
||||
worktreesByRepo: {
|
||||
repo1: [
|
||||
makeWorktree({ id: WT, repoId: 'repo1', path: '/path/wt1', hostId: 'runtime:env-1' })
|
||||
]
|
||||
},
|
||||
activeWorktreeId: WT
|
||||
})
|
||||
store.setState({
|
||||
settings: { ...store.getState().settings, activeRuntimeEnvironmentId: 'runtime-env-1' }
|
||||
recentlyClosedTerminalTabsByWorktree: { [WT]: [{ startupCwd: '/path/wt1/api' }] },
|
||||
recentlyClosedTabKindsByWorktree: { [WT]: ['terminal'] }
|
||||
})
|
||||
|
||||
expect(store.getState().reopenClosedTerminalTab(WT)).toBe(false)
|
||||
|
||||
Reference in New Issue
Block a user