diff --git a/playwright.helpers.config.ts b/playwright.helpers.config.ts index abc670e50..049439202 100644 --- a/playwright.helpers.config.ts +++ b/playwright.helpers.config.ts @@ -12,6 +12,7 @@ export default defineConfig({ /routes\/settings-visual-consistency\.test\.ts/, /routes\/canvas-scale-adjust-intent\.test\.ts/, /routes\/canvas-runtime-internal-endpoint\.test\.ts/, + /routes\/canvas-psd-template-entry\.test\.ts/, /routes\/model-classification\.test\.ts/, /routes\/clawd-request-lifecycle\.test\.ts/, /routes\/canvas-skill-tag-order\.test\.ts/, diff --git a/tests/routes/canvas-psd-template-entry.test.ts b/tests/routes/canvas-psd-template-entry.test.ts new file mode 100644 index 000000000..5b267bb4a --- /dev/null +++ b/tests/routes/canvas-psd-template-entry.test.ts @@ -0,0 +1,26 @@ +import { readFileSync } from "node:fs"; +import { resolve } from "node:path"; +import { expect, test } from "@playwright/test"; + +function readSource(path: string) { + return readFileSync(resolve(process.cwd(), path), "utf8"); +} + +test.describe("canvas PSD template replacement entry", () => { + test("keeps the selected-image toolbar action and launch flow wired", () => { + const imageNode = readSource("components/canvas/nodes/ImageNode.tsx"); + const workspace = readSource("components/canvas/CanvasWorkspace.tsx"); + + expect(imageNode).toContain( + 'getCanvasToolbarItem(\n canvasToolbarConfig,\n "imagePsdTemplateReplace"' + ); + expect(imageNode).toContain('isSelectedImageActionInline("psdTemplate")'); + expect(imageNode).toContain('isSelectedImageActionInMore("psdTemplate")'); + expect(imageNode).toContain('handleAction("psd-template")'); + expect(imageNode).toContain("handleOpenPsdTemplateReplace"); + expect(imageNode).toContain("/psd-template?launch="); + expect(workspace).toContain( + 'requestImageNodeAction(selectedImageNodes[0].id, "psd-template")' + ); + }); +});