mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-10 16:21:22 +00:00
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.
29 lines
970 B
TypeScript
29 lines
970 B
TypeScript
import test from "node:test";
|
|
import assert from "node:assert/strict";
|
|
|
|
import {
|
|
consumePendingDualPaneSftpRequest,
|
|
requestOpenDualPaneSftp,
|
|
resetDualPaneSftpOpenStore,
|
|
subscribeDualPaneSftpOpen,
|
|
} from "./sftpDualPaneOpenStore.ts";
|
|
|
|
test("requestOpenDualPaneSftp stores a pending request when nothing is listening", () => {
|
|
resetDualPaneSftpOpenStore();
|
|
requestOpenDualPaneSftp("host-1");
|
|
assert.deepEqual(consumePendingDualPaneSftpRequest(), { hostId: "host-1", seq: 1 });
|
|
assert.equal(consumePendingDualPaneSftpRequest(), null);
|
|
});
|
|
|
|
test("requestOpenDualPaneSftp delivers live to subscribers instead of queueing", () => {
|
|
resetDualPaneSftpOpenStore();
|
|
const received: string[] = [];
|
|
const unsubscribe = subscribeDualPaneSftpOpen((request) => {
|
|
received.push(request.hostId);
|
|
});
|
|
requestOpenDualPaneSftp("host-2");
|
|
assert.deepEqual(received, ["host-2"]);
|
|
assert.equal(consumePendingDualPaneSftpRequest(), null);
|
|
unsubscribe();
|
|
});
|