Files
Netcatty/components/terminal/ScriptExecutionOverlay.test.ts
T
bincxz b73b73a7ee fix(terminal): keep script overlay clear of compact speed-dial
When the host info bar is hidden, the script execution banner used a
fixed top:34 under empty space and full right edge under the circular
toggle. Raise it and reserve a right gutter so it sits beside the dial
instead of being pushed under it.
2026-07-13 02:44:29 +08:00

35 lines
1.1 KiB
TypeScript

import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import test from "node:test";
import { fileURLToPath } from "node:url";
import {
SCRIPT_OVERLAY_TOP_COMPACT_PX,
SCRIPT_OVERLAY_TOP_DEFAULT_PX,
} from "./ScriptExecutionOverlay.tsx";
test("script overlay sits lower under the full host toolbar than under compact chrome", () => {
assert.equal(SCRIPT_OVERLAY_TOP_DEFAULT_PX, 34);
assert.equal(SCRIPT_OVERLAY_TOP_COMPACT_PX, 8);
assert.ok(SCRIPT_OVERLAY_TOP_COMPACT_PX < SCRIPT_OVERLAY_TOP_DEFAULT_PX);
});
test("script overlay clears the compact speed-dial when host info is hidden", () => {
const overlaySource = readFileSync(
fileURLToPath(new URL("./ScriptExecutionOverlay.tsx", import.meta.url)),
"utf8",
);
const terminalSource = readFileSync(
fileURLToPath(new URL("../Terminal.tsx", import.meta.url)),
"utf8",
);
assert.match(overlaySource, /compactTopChrome/);
assert.match(overlaySource, /right-10/);
assert.match(overlaySource, /SCRIPT_OVERLAY_TOP_COMPACT_PX/);
assert.match(
terminalSource,
/compactTopChrome=\{terminalSettings\?\.showHostInfoBar === false\}/,
);
});