authorgravatar for 51714798+juliusmarminge@users.noreply.github.comJulius Marminge <51714798+juliusmarminge@users.noreply.github.com> 2026-06-12 19:41:59-07:00
committergravatar for me@theo.liTheo Browne <me@theo.li> 2026-06-13 22:18:37-07:00
log18a49abcec35c65547416c2985d4bb6383d78759
tree96a4fc9167f5346d17a5e55220dab95d1807708e
parent85d5df625652906937d5ac330205b1042dc9354f

Fix preview CI test fixtures


4 files changed, 54 insertions(+), 5 deletions(-)

apps/web/src/components/ChatView.browser.tsx+26-5
......@@ -23,6 +23,7 @@ import {
2323 ServerConfig as ServerConfigSchema,
2424} from "@t3tools/contracts";
2525import { scopedThreadKey, scopeThreadRef } from "@t3tools/client-runtime";
26import { DEFAULT_RESOLVED_KEYBINDINGS } from "@t3tools/shared/keybindings";
2627import { createModelCapabilities, createModelSelection } from "@t3tools/shared/model";
2728import { RouterProvider, createMemoryHistory } from "@tanstack/react-router";
2829import * as Option from "effect/Option";
......@@ -2064,6 +2065,14 @@ describe("ChatView timeline estimator parity (full app)", () => {
20642065 targetMessageId: "msg-user-open-empty-terminal-drawer" as MessageId,
20652066 targetText: "open empty terminal drawer",
20662067 }),
2068 configureFixture: (nextFixture) => {
2069 nextFixture.serverConfig = {
2070 ...nextFixture.serverConfig,
2071 keybindings: DEFAULT_RESOLVED_KEYBINDINGS.filter(
2072 (binding) => binding.command === "terminal.toggle",
2073 ),
2074 };
2075 },
20672076 });
20682077
20692078 try {
......@@ -2107,6 +2116,15 @@ describe("ChatView timeline estimator parity (full app)", () => {
21072116 targetMessageId: "msg-user-open-inline-terminal-panel" as MessageId,
21082117 targetText: "open inline terminal panel",
21092118 }),
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 },
21102128 });
21112129
21122130 try {
......@@ -2195,12 +2213,15 @@ describe("ChatView timeline estimator parity (full app)", () => {
21952213 { timeout: 8_000, interval: 16 },
21962214 );
21972215
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 }),
22022224 );
2203 drawerToggle.click();
22042225
22052226 await vi.waitFor(() => {
22062227 expect(
apps/web/src/environments/runtime/service.addSavedEnvironment.test.ts+6
......@@ -157,6 +157,9 @@ vi.mock("@t3tools/client-runtime", async (importOriginal) => {
157157 orchestration: {
158158 subscribeThread: vi.fn(() => () => {}),
159159 },
160 preview: {
161 subscribePorts: vi.fn(() => () => undefined),
162 },
160163 })),
161164 fetchRemoteEnvironmentDescriptor: mockFetchRemoteEnvironmentDescriptor,
162165 fetchRemoteSessionState: mockFetchRemoteSessionState,
......@@ -654,6 +657,9 @@ describe("addSavedEnvironment", () => {
654657 terminal: {
655658 onMetadata: vi.fn(() => () => undefined),
656659 },
660 preview: {
661 subscribePorts: vi.fn(() => () => undefined),
662 },
657663 },
658664 ensureBootstrapped: async () => undefined,
659665 reconnect: vi.fn(async () => {
apps/web/src/environments/runtime/service.savedEnvironments.test.ts+3
......@@ -193,6 +193,9 @@ function createClient() {
193193 close: vi.fn(async () => undefined),
194194 onMetadata: vi.fn(() => () => undefined),
195195 },
196 preview: {
197 subscribePorts: vi.fn(() => () => undefined),
198 },
196199 projects: {
197200 searchEntries: vi.fn(async () => []),
198201 writeFile: vi.fn(async () => undefined),
apps/web/src/localApi.test.ts+19
......@@ -61,6 +61,25 @@ const rpcClientMock = {
6161 filesystem: {
6262 browse: vi.fn(),
6363 },
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 },
6483 sourceControl: {
6584 lookupRepository: vi.fn(),
6685 cloneRepository: vi.fn(),