mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-21 07:32:54 +00:00
* Add telnet URL deep link support * Fix telnet deep link review issues * Keep ssh deep links independent from telnet registration * Address Codex telnet deep link feedback
36 lines
941 B
TypeScript
36 lines
941 B
TypeScript
import assert from "node:assert/strict";
|
|
import test from "node:test";
|
|
|
|
import type { Host } from "../../domain/models";
|
|
import { buildTelnetDeepLinkConnectionHost } from "../../domain/telnetDeepLink";
|
|
import { createHostTerminalSession } from "./sessionFactories";
|
|
|
|
const host = (overrides: Partial<Host>): Host => ({
|
|
id: "host-1",
|
|
label: "Host",
|
|
hostname: "example.com",
|
|
username: "alice",
|
|
port: 22,
|
|
group: "",
|
|
tags: [],
|
|
os: "linux",
|
|
protocol: "ssh",
|
|
createdAt: 1,
|
|
...overrides,
|
|
});
|
|
|
|
test("createHostTerminalSession keeps telnet deep-link default port for ssh hosts with telnet enabled", () => {
|
|
const connectionHost = buildTelnetDeepLinkConnectionHost(
|
|
host({
|
|
protocol: "ssh",
|
|
telnetEnabled: true,
|
|
telnetPort: undefined,
|
|
}),
|
|
);
|
|
|
|
const session = createHostTerminalSession("session-1", connectionHost);
|
|
|
|
assert.equal(session.protocol, "telnet");
|
|
assert.equal(session.port, 23);
|
|
});
|