This commit is contained in:
1 parent
e3a713d2df
commit
e842177d9b
163 files changed
+7390
-1240
No files matched your search
@@ -0,0 +1,19 @@
|
||||
import { describe, expect, test, vi } from "vitest";
|
||||
|
||||
import { createDockerRemovalConfirmation } from "./confirm-docker-container-removal";
|
||||
|
||||
describe("createDockerRemovalConfirmation", () => {
|
||||
test("does not remove containers before explicit confirmation", () => {
|
||||
const remove = vi.fn();
|
||||
const t = vi.fn((key: string, values?: Record<string, string>) => `${key}:${JSON.stringify(values)}`);
|
||||
|
||||
const confirmation = createDockerRemovalConfirmation([{ name: "sonarr" }, { name: "radarr" }], t as never, remove);
|
||||
|
||||
expect(remove).not.toHaveBeenCalled();
|
||||
expect(confirmation.title).toContain('"count":"2"');
|
||||
expect(confirmation.children).toContain('"names":"sonarr, radarr"');
|
||||
|
||||
confirmation.onConfirm();
|
||||
expect(remove).toHaveBeenCalledOnce();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user