mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-30 23:25: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,40 @@
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
const success = vi.fn();
|
||||
vi.mock("sonner", () => ({
|
||||
toast: {
|
||||
success: (...args: unknown[]) => success(...args),
|
||||
},
|
||||
}));
|
||||
|
||||
vi.mock("@/main-axios.ts", () => ({}));
|
||||
vi.mock("../../../features/file-manager/transferNotificationStore.ts", () => ({
|
||||
markTransferNotified: vi.fn(),
|
||||
}));
|
||||
|
||||
import { showTransferCompletionToast } from "../../src/frontend/transferProgressMonitor.tsx";
|
||||
|
||||
describe("transfer completion toast", () => {
|
||||
beforeEach(() => {
|
||||
success.mockReset();
|
||||
});
|
||||
|
||||
it("clears the infinite duration inherited from the progress toast", () => {
|
||||
showTransferCompletionToast(
|
||||
{
|
||||
transferId: "transfer-1",
|
||||
status: "success",
|
||||
phase: "verifying",
|
||||
},
|
||||
((key: string) => key) as never,
|
||||
"progress-toast",
|
||||
);
|
||||
|
||||
expect(success).toHaveBeenCalledWith("transfer.transferSuccess", {
|
||||
id: "progress-toast",
|
||||
description: undefined,
|
||||
className: "!pr-10 !pl-4 transfer-progress-toast",
|
||||
duration: undefined,
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user