feat: add configurable VDO.Ninja overview and floating window focus
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { strict as assert } from 'node:assert'
|
||||
import { test } from 'node:test'
|
||||
import { resolveContainerTerminal } from './containerTerminal'
|
||||
|
||||
const inspection = (running = true) => JSON.stringify([{
|
||||
Id: 'container-id', State: { Running: running }, Mounts: [
|
||||
{ Source: '/home/user/ws', Destination: '/workspace' },
|
||||
{ Source: '/home/user/ws/module', Destination: '/module' }
|
||||
]
|
||||
}])
|
||||
|
||||
test('resolves module path from the most specific actual mount', () => {
|
||||
assert.deepEqual(resolveContainerTerminal(inspection(), '/home/user/ws/module'), { id: 'container-id', cwd: '/module' })
|
||||
assert.equal(resolveContainerTerminal(inspection(), '/home/user/ws/other').cwd, '/workspace/other')
|
||||
})
|
||||
|
||||
test('rejects stopped containers and unrelated workspace paths', () => {
|
||||
assert.throws(() => resolveContainerTerminal(inspection(false), '/home/user/ws/module'), /not running/)
|
||||
assert.throws(() => resolveContainerTerminal(inspection(), '/home/user/ws-other/module'), /not mounted/)
|
||||
})
|
||||
Reference in New Issue
Block a user