Skip to content

Commit a4ffa24

Browse files
committed
test(webui): find the composer's file inputs by the class they carry now
The shared presentation layer replaced the composer's own hidden file inputs with the shared `WebuiFileInput`, and the shared component gives every file input the class `webui-file-input`. The composer's `webui-composer-hidden-file-input` class went with the old markup. Two test files still looked for the removed class, so the locator matched nothing and the cases that attached a file timed out waiting for an element that was never there.
1 parent 80dc5b3 commit a4ffa24

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎packages/webui/test/browser/composer.spec.mjs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ test("history is per session — B's submissions do not leak into A", async ({ p
265265
test("attaching a file and an image renders chips that can be removed", async ({ page }) => {
266266
await openApp(page, "#session=A");
267267

268-
const fileInput = page.locator('input.webui-composer-hidden-file-input[aria-label="添加文件或图片"]');
268+
const fileInput = page.locator('input.webui-file-input[aria-label="添加文件或图片"]');
269269
await fileInput.setInputFiles([
270270
{ name: "notes.txt", mimeType: "text/plain", buffer: Buffer.from("hello attachment") },
271271
{ name: "pixel.png", mimeType: "image/png", buffer: TINY_PNG },
@@ -295,7 +295,7 @@ test("the directory input accepts a folder selection and renders its chips", asy
295295
mkdirSync(path.join(folder, "src"));
296296
writeFileSync(path.join(folder, "root.txt"), "root");
297297
writeFileSync(path.join(folder, "src", "main.ts"), "export {};\n");
298-
const folderInput = page.locator('input.webui-composer-hidden-file-input[aria-label="添加本地文件夹"]');
298+
const folderInput = page.locator('input.webui-file-input[aria-label="添加本地文件夹"]');
299299
await folderInput.setInputFiles(folder);
300300
const chips = page.locator('[data-webui-composer-attachments="true"]');
301301
await expect(chips).toBeVisible();

‎packages/webui/test/integration/agent-transcript.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ it("a real agent turn resumes after refresh and drains a queued message in order
10411041
expect(modelRequests.some((request) => request.body.includes("Create a task checklist.") &&
10421042
request.body.includes("todowrite"))).toBe(true);
10431043

1044-
const attachmentInput = page.locator('input.webui-composer-hidden-file-input[aria-label="添加文件或图片"]');
1044+
const attachmentInput = page.locator('input.webui-file-input[aria-label="添加文件或图片"]');
10451045
await attachmentInput.setInputFiles({
10461046
name: "runtime-note.txt",
10471047
mimeType: "text/plain",

0 commit comments

Comments
 (0)