Files
Netcatty/domain/sftpListDensity.test.ts
T
bincxz 25b79a6947 feat(sftp): tighten bookmarks, compact list, dual-pane entry, and folder scans
Address the SFTP UX list in #3240: wider bookmark management with
confirm/reorder/rename, a compact file-list density, a host-list shortcut
into the existing local/remote dual pane, faster local folder discovery,
and higher small-file upload concurrency.

Tree view already supports double-click to enter directories, so that
item is left as-is.
2026-09-02 14:26:14 +08:00

28 lines
996 B
TypeScript

import test from "node:test";
import assert from "node:assert/strict";
import {
getNextSftpListDensity,
getSftpListDensityToggleLabelKey,
parseSftpListDensity,
sftpFileRowDensityClass,
} from "./sftpListDensity.ts";
test("parseSftpListDensity falls back to comfortable", () => {
assert.equal(parseSftpListDensity("compact"), "compact");
assert.equal(parseSftpListDensity("comfortable"), "comfortable");
assert.equal(parseSftpListDensity("nope"), "comfortable");
assert.equal(parseSftpListDensity(null), "comfortable");
});
test("list density toggle flips compact and comfortable", () => {
assert.equal(getNextSftpListDensity("comfortable"), "compact");
assert.equal(getNextSftpListDensity("compact"), "comfortable");
assert.equal(
getSftpListDensityToggleLabelKey("comfortable"),
"sftp.listDensity.switchToCompact",
);
assert.ok(sftpFileRowDensityClass("compact").includes("py-0.5"));
assert.ok(sftpFileRowDensityClass("comfortable").includes("py-2"));
});