diff --git a/web_src/src/pages/workflowv2/CanvasYamlModal.spec.tsx b/web_src/src/pages/workflowv2/CanvasYamlModal.spec.tsx new file mode 100644 index 0000000000..c39bdc3297 --- /dev/null +++ b/web_src/src/pages/workflowv2/CanvasYamlModal.spec.tsx @@ -0,0 +1,32 @@ +import { fireEvent, render, screen } from "@testing-library/react"; +import { describe, expect, it, vi } from "vitest"; +import { CanvasYamlModal } from "./CanvasYamlModal"; + +vi.mock("@monaco-editor/react", () => ({ + Editor: ({ value }: { value?: string }) =>
{value},
+}));
+
+describe("CanvasYamlModal", () => {
+ const defaultProps = {
+ open: true,
+ onOpenChange: vi.fn(),
+ yamlText: "name: test-canvas",
+ filename: "test-canvas.yaml",
+ };
+
+ it("uses the provided copy handler for copy feedback and error handling", () => {
+ const onCopy = vi.fn();
+
+ render(