Skip to content

Commit e0768d7

Browse files
committed
test(checkpoints): mock useExtensionState in CheckpointSaved spec
CheckpointMenu now depends on ExtensionStateContext for currentTaskId; the unit test renders it without a provider, so mock the hook.
1 parent 70d5988 commit e0768d7

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

webview-ui/src/components/chat/checkpoints/__tests__/CheckpointSaved.spec.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
// Capture onOpenChange from Popover to control open/close in tests
44
let lastOnOpenChange: ((open: boolean) => void) | undefined
55

6+
vi.mock("@src/context/ExtensionStateContext", () => ({
7+
useExtensionState: () => ({ currentTaskId: "test-task-id" }),
8+
}))
9+
610
vi.mock("@/components/ui", () => {
711
// Minimal UI primitives to ensure deterministic behavior in tests
812
return {

0 commit comments

Comments
 (0)