Skip to content

Commit 0ea04d1

Browse files
committed
test(web): lend the panel host to diff recovery tests
1 parent daa046b commit 0ea04d1

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

‎apps/web/src/components/DiffPanel.browser.test.tsx‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ vi.mock("./diffs/AnnotatableCodeView", () => ({ AnnotatableCodeView: () => null
8181
vi.mock("./diffs/DiffFileTree", () => ({ DiffFileTree: () => null }));
8282
vi.mock("./DiffFilePathCopyButton", () => ({ DiffFilePathCopyButton: () => null }));
8383

84-
import DiffPanel from "./DiffPanel";
84+
import DiffSidePanel from "~/panels/diff/DiffSidePanel";
85+
import { PanelHostContext } from "~/panels/panelHost";
8586
import { useDiffPanelSessionStore, useDiffPanelStore } from "~/diffPanelStore";
8687

8788
const cwd = "/project-worktree";
@@ -194,7 +195,17 @@ it.each([
194195
using context = setup(failedBaseRef);
195196
await using screen = await render(
196197
<RegistryContext.Provider value={context.registry}>
197-
<DiffPanel composerDraftTarget={context.threadRef} workspaceMutationId={null} visible />
198+
<PanelHostContext
199+
value={{
200+
threadRef: context.threadRef,
201+
composerDraftTarget: context.threadRef,
202+
workspaceMutationId: null,
203+
visible: true,
204+
sendAnnotation: () => undefined,
205+
}}
206+
>
207+
<DiffSidePanel />
208+
</PanelHostContext>
198209
</RegistryContext.Provider>,
199210
);
200211
await expect.element(screen.getByText(errorMessage, { exact: true })).toBeVisible();

0 commit comments

Comments
 (0)