@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 51 lines 1.84 KB
Raw
1 import { expect } from "e2e";
2
3 import { test, WEB } from "./t3.ts";
4
5 test(
6 "Importing light and dark theme files together keeps their shared custom CSS",
7 WEB,
8 async ({ t3, app, screen, browser }) => {
9 await t3.project("demo");
10 await t3.open("/settings/appearance");
11 await screen.getByRole("button", "Add theme", { exact: true }).tap();
12 const dialog = screen.getByRole("dialog", "Add a theme");
13 await browser.evaluate(() => {
14 const input = document.querySelector<HTMLInputElement>('input[type="file"]');
15 if (!input) throw new Error("Theme file input is missing");
16 const files = new DataTransfer();
17 for (const appearance of ["light", "dark"] as const) {
18 const theme = {
19 version: 1,
20 name: `Aurora ${appearance === "light" ? "Light" : "Dark"}`,
21 appearance,
22 colors: {
23 canvas: appearance === "light" ? "#fafafa" : "#101014",
24 accent: "#6d5ae6",
25 },
26 css: "[data-settings-page-scroll] { outline: 8px solid #ff2d95; outline-offset: -8px; }",
27 };
28 files.items.add(
29 new File([JSON.stringify(theme)], `aurora-${appearance}.json`, {
30 type: "application/json",
31 }),
32 );
33 }
34 input.files = files.files;
35 input.dispatchEvent(new Event("change", { bubbles: true }));
36 return null;
37 });
38 await expect(dialog).toBeHidden();
39 await screen.getByRole("button", "Use Aurora theme", { exact: true }).tap();
40 await app.screenshot("paired-theme-custom-css");
41 await expect
42 .poll(() =>
43 browser.evaluate(() => {
44 const surface = document.querySelector("[data-settings-page-scroll]");
45 if (!surface) throw new Error("Settings surface is missing");
46 return getComputedStyle(surface).outlineWidth;
47 }),
48 )
49 .toBe("8px");
50 },
51 );