Skip to content
This repository was archived by the owner on Aug 6, 2026. It is now read-only.

Commit fe7ba5d

Browse files
test(ui): isolate plan approval presentation
Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
1 parent 8c09151 commit fe7ba5d

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎packages/ui/src/features/sessions/components/session-update/PlanApprovalView.test.tsx‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@ import type { ToolCall } from "@posthog/ui/features/sessions/types";
22
import { Theme } from "@radix-ui/themes";
33
import { render, screen } from "@testing-library/react";
44
import userEvent from "@testing-library/user-event";
5-
import { describe, expect, it } from "vitest";
5+
import { describe, expect, it, vi } from "vitest";
66
import { PlanApprovalView } from "./PlanApprovalView";
77

8+
vi.mock("../../../permissions/PlanContent", () => ({
9+
PlanContent: ({ plan }: { plan: string }) => <div>{plan}</div>,
10+
}));
11+
812
const PLAN_MARKER = "Sentinel plan body for testing";
913

1014
function makeToolCall(overrides: Partial<ToolCall> = {}): ToolCall {
@@ -124,7 +128,7 @@ describe("PlanApprovalView", () => {
124128
}),
125129
});
126130

127-
expect(await screen.findByText("Updated plan")).toBeInTheDocument();
131+
expect(screen.getByText("Updated plan")).toBeInTheDocument();
128132
expect(screen.queryByText("Initial plan")).not.toBeInTheDocument();
129133
});
130134

0 commit comments

Comments
 (0)