Fix preview CI test fixtures

This commit is contained in:
Julius Marminge authored and Theo Browne committed 2026-06-13 22:18:37 -07:00
1 parent 85d5df6256
commit 18a49abcec
4 files changed
+54 -5

No files matched your search

+26 -5
View File
@@ -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(
@@ -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 () => {
@@ -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),
+19
View File
@@ -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(),