The best way to control Claude Code, Codex and more from any computer or phone

main
ts 35 lines 1.33 KB
Raw
1 import { expect } from "e2e";
2
3 import {
4 finishImageCompression,
5 holdImageCompression,
6 pasteWideScreenshot,
7 } from "./image-compression-hold.ts";
8 import { test, WEB } from "./t3.ts";
9
10 test(
11 "Enter while a pasted image compresses sends the message with the image once it finishes",
12 WEB,
13 async ({ t3, app, browser, screen }) => {
14 await holdImageCompression(browser);
15 const project = await t3.project("demo");
16 const thread = await t3.thread({ project, title: "Screenshot work", messages: ["first"] });
17 await t3.open(thread);
18 await expect(screen.getByText("first fixture turn complete", { exact: false })).toBeVisible();
19
20 const composer = screen.getByRole("textbox");
21 await composer.fill("What is in this screenshot?");
22 await pasteWideScreenshot(browser);
23 await browser.keyboard.press("Enter");
24 await app.screenshot("enter-while-compressing");
25
26 await finishImageCompression(browser);
27 await app.screenshot("after-compression");
28 const sentWithImage = browser
29 .locator('[data-message-role="user"]:has([aria-label="Preview screenshot.png"])')
30 .filter({ hasText: "What is in this screenshot?" });
31 await expect(sentWithImage).toBeVisible();
32 await expect(composer).not.toContainText("What is in this screenshot?");
33 await expect(composer).not.toContainText("screenshot.png");
34 },
35 );