Files
orca/src/shared/ssh-target-source.test.ts
T
Neil 49a2203b0e Remote Orca Servers: one list instead of six sections; SSH Hosts: bulk remove that stays removed (#31082)
* feat(settings): one-list Remote Orca Servers page and bulk-manageable SSH Hosts

Remote Orca Servers: replace the three mode cards, Advanced fold, duplicate
managed/SSH-access lists and troubleshooting accordion with a single list
(one row per server: status, one action, overflow menu), an always-visible
'New projects open on' row, and Share / Cloud VM cards that open dialogs.

SSH Hosts: group by source, filter, checkbox + shift-range selection, one
confirm for bulk remove (skipping hosts with a managed server or
workspaces), bulk Test. 'Sync ~/.ssh/config' no longer clears removal
tombstones; 'Restore removed hosts (n)' is a separate confirmed action.

* fix(settings): address review findings on servers and SSH hosts redesign

- SSH filter stays clearable when the list shrinks under the threshold
- Cmd/Ctrl-A only selects hosts when pressed in the list itself
- group legacy no-source hosts with main's import predicate (now shared)
- capture the shift-range anchor before queuing the selection update
- blank server names de-duplicate instead of colliding
- Share dialog Done refreshes link count and resets name editing
- Install / SSH-route dialogs reload SSH hosts when opened
- default-host row shows the selector when the default is a WSL host
- managed 'Not running' no longer masks connecting/revoked/update states
- servers without a dropped transport can be re-checked

* test(e2e): WSL host spec matches repo.rm ending a removed project's shells

repo.rm now stops the project's terminals on the host (#29964), so the
'orphan left by older builds' setup can no longer be built; use a shell
only the host knows of instead. Resolve the project path so macOS
/private/var matches what the host reports.

* fix(settings): carry 'Orca on <host>' naming and paired-twice warning into the new server list

Ports #31099 and #31100 into the redesigned rows, install dialog and SSH
host dialogs.

* test(e2e): keep the WSL spec's project path as created
2026-10-20 05:22:39 -07:00

26 lines
987 B
TypeScript

import { describe, expect, it } from 'vitest'
import { isLegacyConfigImportTarget, isSshConfigSourcedTarget } from './ssh-target-source'
describe('isSshConfigSourcedTarget', () => {
it('trusts an explicit source', () => {
expect(isSshConfigSourcedTarget({ source: 'ssh-config', label: 'a', host: 'a' })).toBe(true)
expect(
isSshConfigSourcedTarget({
source: 'manual',
label: 'box',
configHost: 'box',
host: '10.0.0.5'
})
).toBe(false)
})
it('counts a legacy target as imported only in the old import shape', () => {
expect(isLegacyConfigImportTarget({ label: 'box', configHost: 'box', host: '10.0.0.5' })).toBe(
true
)
// Alias equals the host: nothing was resolved, so it may be a hand-made target.
expect(isLegacyConfigImportTarget({ label: 'box', configHost: 'box', host: 'box' })).toBe(false)
expect(isSshConfigSourcedTarget({ label: 'My box', host: 'box.example.test' })).toBe(false)
})
})