The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 03:37 UTC
| 1 | import { expect } from "e2e"; |
| 2 | |
| 3 | import { test, WEB } from "./t3.ts"; |
| 4 | |
| 5 | // Java's RTFEditorKit writing "Account<em space>Name<en space>Jean<nonbreaking hyphen>Luc". |
| 6 | const JDK_RTF = String.raw`{\rtf1\ansi |
| 7 | {\fonttbl\f0\fnil Monospaced;} |
| 8 | |
| 9 | Account\emspace Name\enspace Jean\_ Luc\par |
| 10 | } |
| 11 | `; |
| 12 | |
| 13 | test( |
| 14 | "An RTF preview keeps the spaces and hyphens written as named control words", |
| 15 | WEB, |
| 16 | async ({ t3, app, screen, browser }) => { |
| 17 | const project = await t3.project("demo", { "contacts.rtf": JDK_RTF }); |
| 18 | const thread = await t3.thread({ project, title: "Review contacts", messages: ["Start"] }); |
| 19 | await t3.open(thread); |
| 20 | await expect(screen.getByText("fixture turn complete", { exact: false })).toBeVisible(); |
| 21 | |
| 22 | await browser.keyboard.press("Control+p"); |
| 23 | await screen.getByPlaceholder("Search files…").fill("contacts.rtf"); |
| 24 | await screen.getByRole("option", "contacts.rtf", { exact: false }).tap(); |
| 25 | |
| 26 | // The first document preview loads its worker, which a cold Vite cache optimizes on demand. |
| 27 | await expect(screen.getByText("1 page", { exact: false })).toBeVisible({ timeout: 120_000 }); |
| 28 | const document = browser.frameLocator('iframe[title^="contacts.rtf"]'); |
| 29 | const body = document.locator("body"); |
| 30 | await expect(body).toContainText("Account"); |
| 31 | await app.screenshot("text"); |
| 32 | await expect(body).toHaveText("Account Name Jean‑ Luc"); |
| 33 | }, |
| 34 | ); |