Files
Netcatty/components/KeychainExportPanel.test.ts
T
2026-07-12 17:58:14 +08:00

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('./KeychainExportPanel.tsx', import.meta.url), 'utf8');
test('key export forwards the selected host SSH connection timeouts', () => {
assert.match(source, /resolveHostSshConnectionTimeouts\(effectiveExportHost\)/);
assert.match(source, /sshTcpConnectTimeoutMs: connectionTimeouts\.tcpConnectTimeoutSeconds \* 1000/);
assert.match(source, /sshAuthReadyTimeoutMs: connectionTimeouts\.authReadyTimeoutSeconds \* 1000/);
});
test('key export preserves imported identity files when the system SSH agent is enabled', () => {
assert.match(
source,
/fallbackIdentityFilePaths: \(!effectiveExportHost\.useSshAgent && exportAuth\.authMethod === "password"\) \|\| exportAuth\.keyId/,
);
});
test('key export passes the selected vault key to agent filtering', () => {
assert.match(source, /resolveBridgeSshAgentAuth\(\s*effectiveExportHost,\s*exportAuth\.key,\s*\)/);
});