authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-09-05 00:26:34-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-05 00:26:34-07:00
log393d1ffc9ee52696e4b5f226a956e9d4c65b2f6a
treeed985f915b3c353bb34c6086bbd17779ab96224c
parent3382b26c4f29bcbc709edf135c5486b7f1e0e211
signature Signed by PGP key B5690EEEBB952194

refactor(mobile): test terminal palettes through public theme API (#10002)


2 files changed, 8 insertions(+), 21 deletions(-)

apps/mobile/src/features/terminal/terminalTheme.test.ts+7-20
......@@ -3,15 +3,11 @@ import { BUILT_IN_THEMES, getThemeColorsForAppearance } from "@t3tools/shared/th
33
44import { themeColorToNativeColor } from "../../lib/mobileTheme";
55
6import {
7 buildGhosttyThemeConfig,
8 getMobileTerminalTheme,
9 getPierreTerminalTheme,
10} from "./terminalTheme";
6import { buildGhosttyThemeConfig, getMobileTerminalTheme } from "./terminalTheme";
117
12describe("getPierreTerminalTheme", () => {
13 it("returns the Pierre light terminal palette", () => {
14 expect(getPierreTerminalTheme("light")).toMatchObject({
8describe("getMobileTerminalTheme", () => {
9 it("preserves the default light terminal palette", () => {
10 expect(getMobileTerminalTheme("t3-code", "light")).toMatchObject({
1511 background: "#f2f2f7",
1612 foreground: "#6C6C71",
1713 cursorForeground: "#009fff",
......@@ -19,23 +15,14 @@ describe("getPierreTerminalTheme", () => {
1915 });
2016 });
2117
22 it("returns the Pierre dark terminal palette", () => {
23 expect(getPierreTerminalTheme("dark")).toMatchObject({
18 it("preserves the default dark terminal palette", () => {
19 expect(getMobileTerminalTheme("t3-code", "dark")).toMatchObject({
2420 background: "#0a0a0a",
2521 foreground: "#adadb1",
2622 cursorForeground: "#009fff",
2723 cursorBackground: "#0a0a0a",
2824 });
2925 });
30});
31
32describe("getMobileTerminalTheme", () => {
33 it("preserves the Pierre terminal for the default theme", () => {
34 for (const scheme of ["light", "dark"] as const) {
35 expect(getMobileTerminalTheme("t3-code", scheme)).toEqual(getPierreTerminalTheme(scheme));
36 }
37 });
38
3926 it("applies the selected palette without replacing ANSI status colors", () => {
4027 const standard = getMobileTerminalTheme("t3-code", "dark");
4128 const ocean = getMobileTerminalTheme("ocean", "dark");
......@@ -58,7 +45,7 @@ describe("getMobileTerminalTheme", () => {
5845
5946describe("buildGhosttyThemeConfig", () => {
6047 it("serializes theme colors into a ghostty config file", () => {
61 const config = buildGhosttyThemeConfig(getPierreTerminalTheme("dark"));
48 const config = buildGhosttyThemeConfig(getMobileTerminalTheme("t3-code", "dark"));
6249
6350 expect(config).toContain("background = #0a0a0a");
6451 expect(config).toContain("foreground = #adadb1");
apps/mobile/src/features/terminal/terminalTheme.ts+1-1
......@@ -74,7 +74,7 @@ const PIERRE_DARK_THEME: TerminalTheme = {
7474 ],
7575};
7676
77export function getPierreTerminalTheme(scheme: TerminalAppearanceScheme): TerminalTheme {
77function getPierreTerminalTheme(scheme: TerminalAppearanceScheme): TerminalTheme {
7878 return scheme === "light" ? PIERRE_LIGHT_THEME : PIERRE_DARK_THEME;
7979}
8080