Files
Netcatty/components/settings/tabs/SettingsTerminalTab.test.ts
T
857429f6dc fix(terminal): show server name in host info bar (#2732)
* fix(#2708): automated Cursor CLI fix

* fix(terminal): let host info bar show label or address

Avoid concatenating both into the toolbar; add a setting so users pick vault label or connection address, with the other kept in the tooltip.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: netcatty-bot <308658023+netcatty-bot@users.noreply.github.com>
Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 13:51:18 +08:00

44 lines
2.0 KiB
TypeScript

import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import test from "node:test";
const source = readFileSync(new URL("./SettingsTerminalTab.tsx", import.meta.url), "utf8");
test("terminal settings expose cursor line highlight toggle", () => {
assert.match(source, /settings\.terminal\.cursor\.highlightLine/);
assert.match(source, /checked=\{terminalSettings\.highlightCursorLine\}/);
assert.match(source, /updateTerminalSetting\("highlightCursorLine", v\)/);
});
test("terminal settings hide terminal theme pickers while following app theme", () => {
assert.match(source, /\{!followAppTerminalTheme && \(/);
assert.doesNotMatch(source, /settings\.terminal\.theme\.followingTheme/);
});
test("terminal settings only update the legacy global theme for the active mode", () => {
assert.match(source, /if \(themeModalSlot === resolvedTheme\) \{\s*setTerminalThemeId\(id\);/);
});
test("terminal settings expose host key verification toggle", () => {
assert.match(source, /settings\.terminal\.connection\.verifyHostKeys/);
assert.match(source, /checked=\{terminalSettings\.verifyHostKeys\}/);
assert.match(source, /updateTerminalSetting\("verifyHostKeys", v\)/);
});
test("terminal settings expose SSH auto reconnect toggle", () => {
assert.match(source, /settings\.terminal\.connection\.sshAutoReconnectEnabled/);
assert.match(source, /checked=\{terminalSettings\.sshAutoReconnectEnabled\}/);
assert.match(source, /updateTerminalSetting\("sshAutoReconnectEnabled", v\)/);
});
test("terminal settings expose the host information bar toggle", () => {
assert.match(source, /checked=\{terminalSettings\.showHostInfoBar\}/);
assert.match(source, /updateTerminalSetting\("showHostInfoBar", v\)/);
});
test("terminal settings expose host information title mode when the bar is shown", () => {
assert.match(source, /terminalSettings\.showHostInfoBar && \(/);
assert.match(source, /updateTerminalSetting\("hostInfoBarTitleMode"/);
assert.match(source, /settings\.terminal\.hostInfoBar\.titleMode/);
});