Files
Netcatty/components/settings/TerminalBehaviorSettings.test.tsx
T
陈大猫 f191a9b449 fix terminal dynamic tab title settings
Add a global dynamic tab title mode, default to agent-only titles, remove the per-host disable control, and keep terminal UI refresh paths in sync with the setting.
2026-06-25 14:34:40 +08:00

33 lines
1.0 KiB
TypeScript

import assert from "node:assert/strict";
import test from "node:test";
import * as terminalBehaviorSettings from "./tabs/TerminalBehaviorSettings.tsx";
const middleClickBehaviorOptions = (
terminalBehaviorSettings as {
MIDDLE_CLICK_BEHAVIOR_OPTIONS?: Array<{ value: string; labelKey: string }>;
}
).MIDDLE_CLICK_BEHAVIOR_OPTIONS;
const dynamicTabTitleModeOptions = (
terminalBehaviorSettings as {
DYNAMIC_TAB_TITLE_MODE_OPTIONS?: Array<{ value: string; labelKey: string }>;
}
).DYNAMIC_TAB_TITLE_MODE_OPTIONS;
test("middle-click settings expose only supported behaviors", () => {
assert.ok(Array.isArray(middleClickBehaviorOptions));
assert.deepEqual(
middleClickBehaviorOptions.map((option) => option.value),
["context-menu", "paste", "disabled"],
);
});
test("dynamic tab title settings expose off, agent-only, and all modes", () => {
assert.ok(Array.isArray(dynamicTabTitleModeOptions));
assert.deepEqual(
dynamicTabTitleModeOptions.map((option) => option.value),
["off", "agent", "all"],
);
});