@devries-cameron20 / t3code-1 / commits / 18a49abcec
Fork 0

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

Fix preview CI test fixtures

Julius Marminge committed Jun 12, 2026 at 19:41 UTC 18a49abcec35c65547416c2985d4bb6383d78759
4 files changed +54 -5
apps/web/src/components/ChatView.browser.tsx
+26 -5
@@ -23,6 +23,7 @@ import {
23 ServerConfig as ServerConfigSchema,
24 } from "@t3tools/contracts";
25 import { scopedThreadKey, scopeThreadRef } from "@t3tools/client-runtime";
26 +import { DEFAULT_RESOLVED_KEYBINDINGS } from "@t3tools/shared/keybindings";
27 import { createModelCapabilities, createModelSelection } from "@t3tools/shared/model";
28 import { RouterProvider, createMemoryHistory } from "@tanstack/react-router";
29 import * as Option from "effect/Option";
@@ -2064,6 +2065,14 @@ describe("ChatView timeline estimator parity (full app)", () => {
2065 targetMessageId: "msg-user-open-empty-terminal-drawer" as MessageId,
2066 targetText: "open empty terminal drawer",
2067 }),
2068 + configureFixture: (nextFixture) => {
2069 + nextFixture.serverConfig = {
2070 + ...nextFixture.serverConfig,
2071 + keybindings: DEFAULT_RESOLVED_KEYBINDINGS.filter(
2072 + (binding) => binding.command === "terminal.toggle",
2073 + ),
2074 + };
2075 + },
2076 });
2077
2078 try {
@@ -2107,6 +2116,15 @@ describe("ChatView timeline estimator parity (full app)", () => {
2116 targetMessageId: "msg-user-open-inline-terminal-panel" as MessageId,
2117 targetText: "open inline terminal panel",
2118 }),
2119 + configureFixture: (nextFixture) => {
2120 + nextFixture.serverConfig = {
2121 + ...nextFixture.serverConfig,
2122 + keybindings: DEFAULT_RESOLVED_KEYBINDINGS.filter(
2123 + (binding) =>
2124 + binding.command === "rightPanel.toggle" || binding.command === "terminal.toggle",
2125 + ),
2126 + };
2127 + },
2128 });
2129
2130 try {
@@ -2195,12 +2213,15 @@ describe("ChatView timeline estimator parity (full app)", () => {
2213 { timeout: 8_000, interval: 16 },
2214 );
2215
2198 - const drawerToggle = await waitForElement(
2199 - () =>
2200 - document.querySelector<HTMLButtonElement>('button[aria-label="Toggle terminal drawer"]'),
2201 - "Unable to find terminal drawer toggle.",
2216 + window.dispatchEvent(
2217 + new KeyboardEvent("keydown", {
2218 + key: "j",
2219 + metaKey: isMacPlatform(navigator.platform),
2220 + ctrlKey: !isMacPlatform(navigator.platform),
2221 + bubbles: true,
2222 + cancelable: true,
2223 + }),
2224 );
2203 - drawerToggle.click();
2225
2226 await vi.waitFor(() => {
2227 expect(
apps/web/src/environments/runtime/service.addSavedEnvironment.test.ts
+6
@@ -157,6 +157,9 @@ vi.mock("@t3tools/client-runtime", async (importOriginal) => {
157 orchestration: {
158 subscribeThread: vi.fn(() => () => {}),
159 },
160 + preview: {
161 + subscribePorts: vi.fn(() => () => undefined),
162 + },
163 })),
164 fetchRemoteEnvironmentDescriptor: mockFetchRemoteEnvironmentDescriptor,
165 fetchRemoteSessionState: mockFetchRemoteSessionState,
@@ -654,6 +657,9 @@ describe("addSavedEnvironment", () => {
657 terminal: {
658 onMetadata: vi.fn(() => () => undefined),
659 },
660 + preview: {
661 + subscribePorts: vi.fn(() => () => undefined),
662 + },
663 },
664 ensureBootstrapped: async () => undefined,
665 reconnect: vi.fn(async () => {
apps/web/src/environments/runtime/service.savedEnvironments.test.ts
+3
@@ -193,6 +193,9 @@ function createClient() {
193 close: vi.fn(async () => undefined),
194 onMetadata: vi.fn(() => () => undefined),
195 },
196 + preview: {
197 + subscribePorts: vi.fn(() => () => undefined),
198 + },
199 projects: {
200 searchEntries: vi.fn(async () => []),
201 writeFile: vi.fn(async () => undefined),
apps/web/src/localApi.test.ts
+19
@@ -61,6 +61,25 @@ const rpcClientMock = {
61 filesystem: {
62 browse: vi.fn(),
63 },
64 + assets: {
65 + createUrl: vi.fn(),
66 + },
67 + preview: {
68 + open: vi.fn(),
69 + navigate: vi.fn(),
70 + refresh: vi.fn(),
71 + close: vi.fn(),
72 + list: vi.fn(),
73 + reportStatus: vi.fn(),
74 + automation: {
75 + connect: vi.fn(() => () => undefined),
76 + respond: vi.fn(),
77 + reportOwner: vi.fn(),
78 + clearOwner: vi.fn(),
79 + },
80 + onEvent: vi.fn(() => () => undefined),
81 + subscribePorts: vi.fn(() => () => undefined),
82 + },
83 sourceControl: {
84 lookupRepository: vi.fn(),
85 cloneRepository: vi.fn(),