mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-31 07:35:24 +00:00
feat: convert file manager into a plugin
This commit is contained in:
1 parent
b76da9ab52
commit
c85c1fdb86
259 files changed
+54155
-16791
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
hasSameHostTransferConflict,
|
||||
joinRemotePath,
|
||||
normalizeRemoteDir,
|
||||
} from "../../src/frontend/sftp-transfer-utils";
|
||||
|
||||
describe("sftp transfer utilities", () => {
|
||||
it("normalizes and joins remote paths", () => {
|
||||
expect(normalizeRemoteDir(" /home/user// ")).toBe("/home/user");
|
||||
expect(joinRemotePath("/home/user/", "docs/readme.md")).toBe(
|
||||
"/home/user/docs/readme.md",
|
||||
);
|
||||
expect(joinRemotePath("/", "tmp/file.txt")).toBe("/tmp/file.txt");
|
||||
expect(joinRemotePath("home/user", "logs")).toBe("/home/user/logs");
|
||||
});
|
||||
|
||||
it("detects same-host destination conflicts", () => {
|
||||
expect(hasSameHostTransferConflict(["/opt/app"], "/opt/app")).toBe(true);
|
||||
expect(hasSameHostTransferConflict(["/opt/app"], "/opt/app/logs")).toBe(
|
||||
true,
|
||||
);
|
||||
expect(hasSameHostTransferConflict(["/opt/app"], "/opt/releases")).toBe(
|
||||
false,
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user