Files
t3code/apps/mobile/src/lib/htmlRenderTheme.test.ts
T
677d1527c3 feat: agents can show HTML pages inline in threads (#15968)
Co-authored-by: Ben Davis <[email protected]>
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-10-05 15:43:07 -07:00

41 lines
1.3 KiB
TypeScript

import { describe, expect, it } from "vite-plus/test";
import { mobileHtmlRenderTheme } from "./htmlRenderTheme";
import { getMobileThemeVariables } from "./mobileTheme";
describe("mobileHtmlRenderTheme", () => {
it("paints the page with the feed's own canvas", () => {
const variables = {
...getMobileThemeVariables("grove", "dark"),
"--color-thread-canvas": "#101010",
};
const theme = (platform: string) =>
mobileHtmlRenderTheme({
themeId: "grove",
appearance: "dark",
variables,
systemColors: false,
platform,
});
expect(theme("android").variables["--background"]).toBe("#101010");
expect(theme("ios").variables["--background"]).toBe(variables["--color-screen"]);
});
it("takes Material You's system roles over the default palette", () => {
const variables = {
...getMobileThemeVariables("t3-code", "light"),
"--color-primary": "#6750A4FF",
"--color-foreground": "#1D1B20FF",
};
const theme = mobileHtmlRenderTheme({
themeId: "material-you",
appearance: "light",
variables,
systemColors: true,
platform: "android",
});
expect(theme.variables["--accent"]).toBe("#6750A4FF");
expect(theme.variables["--foreground"]).toBe("#1D1B20FF");
});
});