mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-10-09 15:58:34 +00:00
ec2f0d0bce
* fix: support native file dragging from local filesystem panes * fix: preserve symlink-aware paths during native file drag
16 lines
738 B
JavaScript
16 lines
738 B
JavaScript
const assert = require("node:assert/strict");
|
|
const test = require("node:test");
|
|
const { createPreloadApi } = require("./api.cjs");
|
|
|
|
test("local file drag exposes only the dedicated start and cancellation channels", async () => {
|
|
const calls = [];
|
|
const api = createPreloadApi({ ipcRenderer: {
|
|
invoke: async (...args) => { calls.push(args); return { started: true }; },
|
|
send: (...args) => calls.push(args),
|
|
}, webUtils: {} });
|
|
const payload = { requestId: "one", paths: ["/file"] };
|
|
assert.deepEqual(await api.startLocalFileDrag(payload), { started: true });
|
|
api.cancelLocalFileDrag("one");
|
|
assert.deepEqual(calls, [["netcatty:local:drag-start", payload], ["netcatty:local:drag-cancel", { requestId: "one" }]]);
|
|
});
|