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 {...@@ -23,6 +23,7 @@ import {
23 ServerConfig as ServerConfigSchema,23 ServerConfig as ServerConfigSchema,
24} from "@t3tools/contracts";24} from "@t3tools/contracts";
25import { scopedThreadKey, scopeThreadRef } from "@t3tools/client-runtime";25import { scopedThreadKey, scopeThreadRef } from "@t3tools/client-runtime";
26import { DEFAULT_RESOLVED_KEYBINDINGS } from "@t3tools/shared/keybindings";
26import { createModelCapabilities, createModelSelection } from "@t3tools/shared/model";27import { createModelCapabilities, createModelSelection } from "@t3tools/shared/model";
27import { RouterProvider, createMemoryHistory } from "@tanstack/react-router";28import { RouterProvider, createMemoryHistory } from "@tanstack/react-router";
28import * as Option from "effect/Option";29import * as Option from "effect/Option";
...@@ -2064,6 +2065,14 @@ describe("ChatView timeline estimator parity (full app)", () => {...@@ -2064,6 +2065,14 @@ describe("ChatView timeline estimator parity (full app)", () => {
2064 targetMessageId: "msg-user-open-empty-terminal-drawer" as MessageId,2065 targetMessageId: "msg-user-open-empty-terminal-drawer" as MessageId,
2065 targetText: "open empty terminal drawer",2066 targetText: "open empty terminal drawer",
2066 }),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 },
2067 });2076 });
20682077
2069 try {2078 try {
...@@ -2107,6 +2116,15 @@ describe("ChatView timeline estimator parity (full app)", () => {...@@ -2107,6 +2116,15 @@ describe("ChatView timeline estimator parity (full app)", () => {
2107 targetMessageId: "msg-user-open-inline-terminal-panel" as MessageId,2116 targetMessageId: "msg-user-open-inline-terminal-panel" as MessageId,
2108 targetText: "open inline terminal panel",2117 targetText: "open inline terminal panel",
2109 }),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 },
2110 });2128 });
21112129
2112 try {2130 try {
...@@ -2195,12 +2213,15 @@ describe("ChatView timeline estimator parity (full app)", () => {...@@ -2195,12 +2213,15 @@ describe("ChatView timeline estimator parity (full app)", () => {
2195 { timeout: 8_000, interval: 16 },2213 { timeout: 8_000, interval: 16 },
2196 );2214 );
21972215
2198 const drawerToggle = await waitForElement(2216 window.dispatchEvent(
2199 () =>2217 new KeyboardEvent("keydown", {
2200 document.querySelector<HTMLButtonElement>('button[aria-label="Toggle terminal drawer"]'),2218 key: "j",
2201 "Unable to find terminal drawer toggle.",2219 metaKey: isMacPlatform(navigator.platform),
2220 ctrlKey: !isMacPlatform(navigator.platform),
2221 bubbles: true,
2222 cancelable: true,
2223 }),
2202 );2224 );
2203 drawerToggle.click();
22042225
2205 await vi.waitFor(() => {2226 await vi.waitFor(() => {
2206 expect(2227 expect(
apps/web/src/environments/runtime/service.addSavedEnvironment.test.ts+6
...@@ -157,6 +157,9 @@ vi.mock("@t3tools/client-runtime", async (importOriginal) => {...@@ -157,6 +157,9 @@ vi.mock("@t3tools/client-runtime", async (importOriginal) => {
157 orchestration: {157 orchestration: {
158 subscribeThread: vi.fn(() => () => {}),158 subscribeThread: vi.fn(() => () => {}),
159 },159 },
160 preview: {
161 subscribePorts: vi.fn(() => () => undefined),
162 },
160 })),163 })),
161 fetchRemoteEnvironmentDescriptor: mockFetchRemoteEnvironmentDescriptor,164 fetchRemoteEnvironmentDescriptor: mockFetchRemoteEnvironmentDescriptor,
162 fetchRemoteSessionState: mockFetchRemoteSessionState,165 fetchRemoteSessionState: mockFetchRemoteSessionState,
...@@ -654,6 +657,9 @@ describe("addSavedEnvironment", () => {...@@ -654,6 +657,9 @@ describe("addSavedEnvironment", () => {
654 terminal: {657 terminal: {
655 onMetadata: vi.fn(() => () => undefined),658 onMetadata: vi.fn(() => () => undefined),
656 },659 },
660 preview: {
661 subscribePorts: vi.fn(() => () => undefined),
662 },
657 },663 },
658 ensureBootstrapped: async () => undefined,664 ensureBootstrapped: async () => undefined,
659 reconnect: vi.fn(async () => {665 reconnect: vi.fn(async () => {
apps/web/src/environments/runtime/service.savedEnvironments.test.ts+3
...@@ -193,6 +193,9 @@ function createClient() {...@@ -193,6 +193,9 @@ function createClient() {
193 close: vi.fn(async () => undefined),193 close: vi.fn(async () => undefined),
194 onMetadata: vi.fn(() => () => undefined),194 onMetadata: vi.fn(() => () => undefined),
195 },195 },
196 preview: {
197 subscribePorts: vi.fn(() => () => undefined),
198 },
196 projects: {199 projects: {
197 searchEntries: vi.fn(async () => []),200 searchEntries: vi.fn(async () => []),
198 writeFile: vi.fn(async () => undefined),201 writeFile: vi.fn(async () => undefined),
apps/web/src/localApi.test.ts+19
...@@ -61,6 +61,25 @@ const rpcClientMock = {...@@ -61,6 +61,25 @@ const rpcClientMock = {
61 filesystem: {61 filesystem: {
62 browse: vi.fn(),62 browse: vi.fn(),
63 },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 },
64 sourceControl: {83 sourceControl: {
65 lookupRepository: vi.fn(),84 lookupRepository: vi.fn(),
66 cloneRepository: vi.fn(),85 cloneRepository: vi.fn(),