Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

Fix preview CI test fixtures

Julius Marminge18a49abcec35
diff --git a/apps/web/src/components/ChatView.browser.tsx b/apps/web/src/components/ChatView.browser.tsx
index 9e939e838..11d1ea121 100644
--- a/apps/web/src/components/ChatView.browser.tsx
+++ b/apps/web/src/components/ChatView.browser.tsx
@@ -23,6 +23,7 @@ import {
ServerConfig as ServerConfigSchema,
} from "@t3tools/contracts";
import { scopedThreadKey, scopeThreadRef } from "@t3tools/client-runtime";
+import { DEFAULT_RESOLVED_KEYBINDINGS } from "@t3tools/shared/keybindings";
import { createModelCapabilities, createModelSelection } from "@t3tools/shared/model";
import { RouterProvider, createMemoryHistory } from "@tanstack/react-router";
import * as Option from "effect/Option";
@@ -2064,6 +2065,14 @@ describe("ChatView timeline estimator parity (full app)", () => {
targetMessageId: "msg-user-open-empty-terminal-drawer" as MessageId,
targetText: "open empty terminal drawer",
}),
+ configureFixture: (nextFixture) => {
+ nextFixture.serverConfig = {
+ ...nextFixture.serverConfig,
+ keybindings: DEFAULT_RESOLVED_KEYBINDINGS.filter(
+ (binding) => binding.command === "terminal.toggle",
+ ),
+ };
+ },
});
try {
@@ -2107,6 +2116,15 @@ describe("ChatView timeline estimator parity (full app)", () => {
targetMessageId: "msg-user-open-inline-terminal-panel" as MessageId,
targetText: "open inline terminal panel",
}),
+ configureFixture: (nextFixture) => {
+ nextFixture.serverConfig = {
+ ...nextFixture.serverConfig,
+ keybindings: DEFAULT_RESOLVED_KEYBINDINGS.filter(
+ (binding) =>
+ binding.command === "rightPanel.toggle" || binding.command === "terminal.toggle",
+ ),
+ };
+ },
});
try {
@@ -2195,12 +2213,15 @@ describe("ChatView timeline estimator parity (full app)", () => {
{ timeout: 8_000, interval: 16 },
);
- const drawerToggle = await waitForElement(
- () =>
- document.querySelector<HTMLButtonElement>('button[aria-label="Toggle terminal drawer"]'),
- "Unable to find terminal drawer toggle.",
+ window.dispatchEvent(
+ new KeyboardEvent("keydown", {
+ key: "j",
+ metaKey: isMacPlatform(navigator.platform),
+ ctrlKey: !isMacPlatform(navigator.platform),
+ bubbles: true,
+ cancelable: true,
+ }),
);
- drawerToggle.click();
await vi.waitFor(() => {
expect(
diff --git a/apps/web/src/environments/runtime/service.addSavedEnvironment.test.ts b/apps/web/src/environments/runtime/service.addSavedEnvironment.test.ts
index e7f2e60b5..f099338ab 100644
--- a/apps/web/src/environments/runtime/service.addSavedEnvironment.test.ts
+++ b/apps/web/src/environments/runtime/service.addSavedEnvironment.test.ts
@@ -157,6 +157,9 @@ vi.mock("@t3tools/client-runtime", async (importOriginal) => {
orchestration: {
subscribeThread: vi.fn(() => () => {}),
},
+ preview: {
+ subscribePorts: vi.fn(() => () => undefined),
+ },
})),
fetchRemoteEnvironmentDescriptor: mockFetchRemoteEnvironmentDescriptor,
fetchRemoteSessionState: mockFetchRemoteSessionState,
@@ -654,6 +657,9 @@ describe("addSavedEnvironment", () => {
terminal: {
onMetadata: vi.fn(() => () => undefined),
},
+ preview: {
+ subscribePorts: vi.fn(() => () => undefined),
+ },
},
ensureBootstrapped: async () => undefined,
reconnect: vi.fn(async () => {
diff --git a/apps/web/src/environments/runtime/service.savedEnvironments.test.ts b/apps/web/src/environments/runtime/service.savedEnvironments.test.ts
index e7c15ec6b..592bc31e2 100644
--- a/apps/web/src/environments/runtime/service.savedEnvironments.test.ts
+++ b/apps/web/src/environments/runtime/service.savedEnvironments.test.ts
@@ -193,6 +193,9 @@ function createClient() {
close: vi.fn(async () => undefined),
onMetadata: vi.fn(() => () => undefined),
},
+ preview: {
+ subscribePorts: vi.fn(() => () => undefined),
+ },
projects: {
searchEntries: vi.fn(async () => []),
writeFile: vi.fn(async () => undefined),
diff --git a/apps/web/src/localApi.test.ts b/apps/web/src/localApi.test.ts
index e50dbd9f5..f81a7259c 100644
--- a/apps/web/src/localApi.test.ts
+++ b/apps/web/src/localApi.test.ts
@@ -61,6 +61,25 @@ const rpcClientMock = {
filesystem: {
browse: vi.fn(),
},
+ assets: {
+ createUrl: vi.fn(),
+ },
+ preview: {
+ open: vi.fn(),
+ navigate: vi.fn(),
+ refresh: vi.fn(),
+ close: vi.fn(),
+ list: vi.fn(),
+ reportStatus: vi.fn(),
+ automation: {
+ connect: vi.fn(() => () => undefined),
+ respond: vi.fn(),
+ reportOwner: vi.fn(),
+ clearOwner: vi.fn(),
+ },
+ onEvent: vi.fn(() => () => undefined),
+ subscribePorts: vi.fn(() => () => undefined),
+ },
sourceControl: {
lookupRepository: vi.fn(),
cloneRepository: vi.fn(),