Some checks failed
build-packages / resolve bundled mosh-client (push) Has been cancelled
build-packages / resolve bundled et-client (push) Has been cancelled
build-packages / build-macos (push) Has been cancelled
build-packages / build-windows (push) Has been cancelled
build-packages / build-linux-x64 (push) Has been cancelled
build-packages / build-linux-arm64 (push) Has been cancelled
build-packages / release (push) Has been cancelled
build-packages / update Nix release metadata (push) Has been cancelled
build-packages / bump homebrew tap (push) Has been cancelled
test / lint-and-test (push) Has been cancelled
AI automation / Route event (push) Has been cancelled
AI automation / Hand reopened issue to maintainers (push) Has been cancelled
AI automation / Clean source issue state (push) Has been cancelled
AI automation / Reconcile handoffs (push) Has been cancelled
AI automation / Classify issue (push) Has been cancelled
AI automation / Claude Code smoke (push) Has been cancelled
AI automation / Review issue follow-up (push) Has been cancelled
AI automation / Publish issue follow-up (push) Has been cancelled
AI automation / Implement with Claude Code (push) Has been cancelled
AI automation / Publish implement PR (push) Has been cancelled
AI automation / Continue queued issue comments (push) Has been cancelled
AI automation / Codex review loop (push) Has been cancelled
AI automation / Publish Codex fix (push) Has been cancelled
AI automation / Clear Codex dispatch marker (push) Has been cancelled
AI automation / Own PR re-request Codex (push) Has been cancelled
AI automation / External PR re-request Codex (push) Has been cancelled
AI automation / Poll Codex reaction / retry (push) Has been cancelled
build-et-binaries / build-linux-x64 (push) Has been cancelled
build-et-binaries / build-linux-arm64 (push) Has been cancelled
build-et-binaries / build-macos-universal (push) Has been cancelled
build-et-binaries / build-windows-x64 (push) Has been cancelled
build-et-binaries / release (push) Has been cancelled
108 lines
4.2 KiB
TypeScript
108 lines
4.2 KiB
TypeScript
import assert from "node:assert/strict";
|
|
import { readFileSync } from "node:fs";
|
|
import { join } from "node:path";
|
|
import test from "node:test";
|
|
|
|
const root = new URL("..", import.meta.url);
|
|
|
|
function readProjectFile(path: string): string {
|
|
return readFileSync(join(root.pathname, path), "utf8");
|
|
}
|
|
|
|
test("terminal side panel exposes stable custom CSS regions", () => {
|
|
const source = readProjectFile("components/terminalLayer/TerminalLayerSidePanelSection.tsx");
|
|
|
|
assert.match(source, /terminal-side-panel-shell/);
|
|
assert.match(source, /terminal-side-panel-tabs/);
|
|
assert.match(source, /terminal-side-panel-content/);
|
|
assert.match(source, /terminal-side-panel-resizer/);
|
|
assert.match(source, /isSidePanelOpenForCurrentTab \? 'terminal-side-panel' : undefined/);
|
|
});
|
|
|
|
test("terminal side panel shell is isolated from surrounding layout churn", () => {
|
|
const source = readProjectFile("components/terminalLayer/TerminalLayerSidePanelSection.tsx");
|
|
|
|
assert.match(source, /contain: 'layout paint style'/);
|
|
});
|
|
|
|
test("SFTP panel exposes stable custom CSS regions", () => {
|
|
const source = [
|
|
readProjectFile("components/SftpSidePanel.tsx"),
|
|
readProjectFile("components/sftp/SftpPaneView.tsx"),
|
|
readProjectFile("components/sftp/SftpPaneToolbar.tsx"),
|
|
readProjectFile("components/sftp/SftpPaneFileList.tsx"),
|
|
readProjectFile("components/sftp/SftpFileRow.tsx"),
|
|
readProjectFile("components/sftp/SftpPaneTreeView.tsx"),
|
|
readProjectFile("components/sftp/SftpPaneTreeNode.tsx"),
|
|
readProjectFile("components/sftp/SftpTransferQueue.tsx"),
|
|
].join("\n");
|
|
|
|
[
|
|
"terminal-sftp-panel",
|
|
"terminal-sftp-host-header",
|
|
"terminal-sftp-pane",
|
|
"terminal-sftp-toolbar",
|
|
"terminal-sftp-path",
|
|
"terminal-sftp-filter-bar",
|
|
"terminal-sftp-list",
|
|
"terminal-sftp-list-header",
|
|
"terminal-sftp-list-row",
|
|
"terminal-sftp-tree",
|
|
"terminal-sftp-tree-row",
|
|
"terminal-sftp-transfer-queue",
|
|
"terminal-sftp-transfer-queue-header",
|
|
"terminal-sftp-transfer-list",
|
|
].forEach((hook) => assert.match(source, new RegExp(hook)));
|
|
});
|
|
|
|
test("terminal host tree exposes stable custom CSS regions", () => {
|
|
const source = readProjectFile("components/terminalLayer/TerminalHostTreeSidebar.tsx");
|
|
|
|
assert.match(source, /terminal-host-tree-sidebar-shell/);
|
|
assert.match(source, /terminal-host-tree-sidebar/);
|
|
assert.match(source, /terminal-host-tree-sidebar-content/);
|
|
});
|
|
|
|
test("toolbars expose stable custom CSS regions for icon sizing", () => {
|
|
const topTabsSource = readProjectFile("components/TopTabs.tsx");
|
|
const terminalToolbarSource = readProjectFile("components/terminal/TerminalToolbar.tsx");
|
|
const terminalViewSource = readProjectFile("components/terminal/TerminalView.tsx");
|
|
const overflowSection = topTabsSource.slice(
|
|
topTabsSource.indexOf('{hasOverflow && ('),
|
|
topTabsSource.indexOf('/* Fixed right controls'),
|
|
);
|
|
|
|
assert.match(topTabsSource, /top-tabs-toolbar-actions/);
|
|
assert.match(overflowSection, /data-section="top-tabs-toolbar-actions"/);
|
|
assert.match(terminalToolbarSource, /data-section="terminal-toolbar"/);
|
|
assert.match(terminalToolbarSource, /terminal-toolbar-menu/);
|
|
assert.match(terminalViewSource, /data-section="terminal-toolbar"/);
|
|
assert.ok((terminalViewSource.match(/data-section="terminal-toolbar"/g) ?? []).length >= 2);
|
|
assert.ok(
|
|
terminalToolbarSource.indexOf('data-section="terminal-toolbar"')
|
|
< terminalToolbarSource.indexOf('{pluginToolbarMenus.map'),
|
|
);
|
|
assert.ok(
|
|
terminalToolbarSource.indexOf('{pluginToolbarMenus.map')
|
|
< terminalToolbarSource.lastIndexOf('</TooltipProvider>'),
|
|
);
|
|
});
|
|
|
|
test("custom CSS help lists the expanded terminal and SFTP hooks", () => {
|
|
const source = readProjectFile("application/i18n/locales/zh-CN/core.ts");
|
|
|
|
[
|
|
"terminal-side-panel-tabs",
|
|
"terminal-side-panel-content",
|
|
"terminal-sftp-toolbar",
|
|
"terminal-sftp-list-row",
|
|
"terminal-sftp-tree-row",
|
|
"terminal-sftp-transfer-queue",
|
|
"terminal-host-tree-sidebar-content",
|
|
"top-tabs-toolbar-actions",
|
|
"terminal-toolbar",
|
|
"terminal-toolbar-menu",
|
|
].forEach((hook) => assert.match(source, new RegExp(hook)));
|
|
assert.match(source, /\[data-plugin-icon-kind="package"\]/);
|
|
});
|