From 611f0d0c82cf155f1aa4601b9a4afe38a4d55463 Mon Sep 17 00:00:00 2001 From: ddCat <2695092045@qq.com> Date: Sun, 16 Aug 2026 13:15:51 +0800 Subject: [PATCH] =?UTF-8?q?test(canvas):=20=E5=88=9B=E4=BD=9C=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E5=8F=B0=20-=20=E6=9B=B4=E6=96=B0=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E4=B8=8E=E7=B4=A0=E6=9D=90=E5=BA=93=E5=85=A5=E5=8F=A3=E6=96=AD?= =?UTF-8?q?=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/test/create-library-button.test.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/web/test/create-library-button.test.ts b/web/test/create-library-button.test.ts index 480e9052f..347a98346 100644 --- a/web/test/create-library-button.test.ts +++ b/web/test/create-library-button.test.ts @@ -14,9 +14,16 @@ describe("creation library button", () => { expect(dockStart).toBeGreaterThanOrEqual(0); expect(dockEnd).toBeGreaterThan(dockStart); - expect(compactSource(source.slice(dockStart, dockEnd))).toMatch( - / ]*>\s*]*className="creation-chat-control")(?=[^>]*onClick=\{props\.onOpenLibrary\})(?=[^>]*disabled=\{props\.busy \|\| !referencesSupported\})(?=[^>]*aria-label="打开素材库选择参考内容")[^>]*>\s*\s*素材库<\/span>\s*<\/button>\s*<\/Tooltip>/, - ); + const dockSource = compactSource(source.slice(dockStart, dockEnd)); + const modePickerIndex = dockSource.indexOf(" { @@ -39,7 +46,8 @@ describe("creation library button", () => { const createSource = readFileSync(resolve(import.meta.dir, "../src/pages/create/index.tsx"), "utf8"); const canvasSource = readFileSync(resolve(import.meta.dir, "../src/components/canvas/canvas-node-prompt-panel.tsx"), "utf8"); - expect(createSource).toContain('className="creation-chat-attachment-preview"'); + expect(createSource).toContain('className="creation-user-message-attachments"'); + expect(createSource).toContain('setPreviewType(kind === "video" ? "video" : "image")'); expect(createSource).toContain("