The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import { expect } from "e2e"; |
| 2 | |
| 3 | import { test, WEB } from "./t3.ts"; |
| 4 | |
| 5 | test( |
| 6 | "Edit from here puts a sent message back with its thread mention", |
| 7 | WEB, |
| 8 | async ({ t3, app, screen, browser }) => { |
| 9 | const project = await t3.project("demo"); |
| 10 | await t3.thread({ project, title: "Release notes", messages: ["Draft the notes"] }); |
| 11 | const thread = await t3.thread({ project, title: "Review work", messages: ["Start"] }); |
| 12 | await t3.open(thread); |
| 13 | |
| 14 | const composer = screen.getByRole("textbox"); |
| 15 | await composer.pressSequentially("Review @Release"); |
| 16 | await screen.getByRole("option", "Release notes", { exact: false }).tap(); |
| 17 | await expect(composer).toContainText("Release notes"); |
| 18 | await browser.keyboard.press("Enter"); |
| 19 | |
| 20 | // The seeded message came from the CLI, which the timeline attributes to an agent: only the |
| 21 | // message sent here offers Edit from here. |
| 22 | const editFromHere = screen.getByRole("button", "Edit from here"); |
| 23 | await expect(editFromHere).toHaveCount(1, { timeout: 60_000 }); |
| 24 | await expect(editFromHere).toBeEnabled({ timeout: 60_000 }); |
| 25 | await editFromHere.tap(); |
| 26 | await screen.getByRole("button", "Revert and keep changes").tap(); |
| 27 | |
| 28 | await expect(composer).toContainText("Review"); |
| 29 | await app.screenshot("restored-draft"); |
| 30 | await expect(composer).toContainText("Release notes"); |
| 31 | }, |
| 32 | ); |