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

main
ts 50 lines 1.49 KB
Raw
1 /// <reference lib="dom" />
2 import { expect } from "e2e";
3
4 import { makeState, runPromise, test, WEB } from "./t3.ts";
5
6 const NOTE = "userdata/themes/nightfall.json/notes.txt";
7 const BODY = "Notes for the original Nightfall palette";
8
9 test(
10 "Publishing a theme preserves files in an existing directory under the same name",
11 WEB,
12 async ({ t3, app, browser, screen }) => {
13 const project = await t3.project("theme-workspace", {
14 [NOTE]: BODY,
15 "nightfall.json": JSON.stringify({
16 name: "Nightfall",
17 appearance: "dark",
18 canvas: "#1a1b26",
19 accent: "#7aa2f7",
20 }),
21 });
22 const thread = await t3.thread({
23 project,
24 title: "Theme notes",
25 messages: [`See :codex-file-citation{path="${NOTE}" line_range_start="1"}`],
26 });
27 const { cli } = makeState(project);
28 await runPromise(cli(["theme", "set", `${project}/nightfall.json`], [0, 1]));
29
30 await t3.open(thread);
31 await screen.getByRole("button", /^Agent See/).tap();
32 await screen.getByRole("link", /^notes\.txt/).tap();
33
34 try {
35 await expect
36 .poll(() =>
37 browser.evaluate(() => {
38 for (const host of document.querySelectorAll("*")) {
39 const content = host.shadowRoot?.querySelector("[data-content]");
40 if (content) return content.textContent ?? "";
41 }
42 return null;
43 }),
44 )
45 .toContain(BODY);
46 } finally {
47 await app.screenshot("open-original-theme-notes");
48 }
49 },
50 );