test(canvas): guard PSD template toolbar entry
This commit is contained in:
parent
01722af2fb
commit
9ff3dc68ce
@ -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\/model3d-style-pro-regressions\.test\.ts/,
|
||||
/routes\/clawd-request-lifecycle\.test\.ts/,
|
||||
|
||||
26
tests/routes/canvas-psd-template-entry.test.ts
Normal file
26
tests/routes/canvas-psd-template-entry.test.ts
Normal file
@ -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")'
|
||||
);
|
||||
});
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user