Files
Netcatty/components/terminalLayer/TerminalLayerTabBridge.test.ts
T

23 lines
1.0 KiB
TypeScript

import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
import test from 'node:test';
const source = readFileSync(new URL('./TerminalLayerTabBridge.tsx', import.meta.url), 'utf8');
test('terminal layer bridge does not dock the shared host tree', () => {
assert.doesNotMatch(source, /hostTreeDockedInLayer/);
});
test('terminal layer is visible only for terminal sessions or workspaces', () => {
assert.match(source, /const isVisible = Boolean\(activeSession \|\| activeWorkspace \|\| s\.draggingSessionId\)/);
});
test('terminal panes can gate cwd restore per session host resolution', () => {
const supportSource = readFileSync(new URL('./TerminalLayerSupport.tsx', import.meta.url), 'utf8');
const layerSource = readFileSync(new URL('../TerminalLayer.tsx', import.meta.url), 'utf8');
assert.match(supportSource, /sessionHostResolved: boolean/);
assert.match(supportSource, /restoreTerminalCwd=\{restoreTerminalCwd && sessionHostResolved\}/);
assert.match(layerSource, /session\.protocol === 'local'/);
});