Skip to content

Commit 46b0377

Browse files
committed
test(app): mock context menu in file tree tests
1 parent 606e690 commit 46b0377

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/app/src/components/file-tree.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ beforeAll(async () => {
2828
}))
2929
mock.module("@opencode-ai/ui/file-icon", () => ({ FileIcon: () => null }))
3030
mock.module("@opencode-ai/ui/icon", () => ({ Icon: () => null }))
31+
mock.module("@opencode-ai/ui/context-menu", () => ({
32+
ContextMenu: {
33+
Trigger: (props: { children?: unknown }) => props.children,
34+
Portal: (props: { children?: unknown }) => props.children,
35+
Content: (props: { children?: unknown }) => props.children,
36+
Item: (props: { children?: unknown }) => props.children,
37+
ItemLabel: (props: { children?: unknown }) => props.children,
38+
Separator: () => null,
39+
},
40+
}))
3141
mock.module("@opencode-ai/ui/tooltip", () => ({ Tooltip: (props: { children?: unknown }) => props.children }))
3242
const mod = await import("./file-tree")
3343
shouldListRoot = mod.shouldListRoot

0 commit comments

Comments
 (0)