@devries-cameron20 / t3code Mirror · read-only
Fork 0

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

main
ts 44 lines 1.47 KB
Raw
1 /// <reference lib="dom" />
2 import { expect } from "e2e";
3
4 import { test, WEB } from "./t3.ts";
5
6 const CONTENT = String.raw`"Theme preview: \"ready\""`;
7
8 test(
9 "A theme renders custom text containing quotation marks",
10 WEB,
11 async ({ t3, app, screen, browser }) => {
12 await t3.project("demo");
13 await t3.open("/settings/appearance");
14 await screen.getByRole("button", "Add theme", { exact: true }).tap();
15 const dialog = screen.getByRole("dialog", "Add a theme");
16 await dialog.getByRole("textbox", "Theme JSON").fill(
17 JSON.stringify({
18 version: 1,
19 name: "Quoted Preview",
20 appearance: "light",
21 colors: { canvas: "#ffffff", accent: "#734ee4" },
22 css: `[data-settings-page-scroll]::before { display: block; content: ${CONTENT}; }`,
23 }),
24 );
25 await dialog.getByRole("button", "Add theme", { exact: true }).tap();
26 await dialog.waitFor({ state: "hidden" });
27 await screen.getByRole("button", "Use Quoted Preview theme", { exact: true }).tap();
28
29 try {
30 await expect
31 .poll(
32 () =>
33 browser.evaluate(() => {
34 const settings = document.querySelector("[data-settings-page-scroll]");
35 return settings ? getComputedStyle(settings, "::before").content : "";
36 }),
37 { message: "The selected theme displays its custom text with quotation marks" },
38 )
39 .toBe(CONTENT);
40 } finally {
41 await app.screenshot("theme-custom-text");
42 }
43 },
44 );