diff --git a/apps/ai-game-creator-shell/tests/uiEditorPreview.test.tsx b/apps/ai-game-creator-shell/tests/uiEditorPreview.test.tsx index a2dece1ba..963283a51 100644 --- a/apps/ai-game-creator-shell/tests/uiEditorPreview.test.tsx +++ b/apps/ai-game-creator-shell/tests/uiEditorPreview.test.tsx @@ -366,7 +366,7 @@ describe('UI tree preview visibility', () => { expect(onSelectChild).toHaveBeenCalledWith('child-b'); }); - it('opens a context-menu target only from editor overlay nodes', () => { + it('passes context-menu targets with the optional tree id', () => { const onNodeContextMenu = vi.fn(); const onSelectNode = vi.fn(); const editorOverlay = render( @@ -399,6 +399,7 @@ describe('UI tree preview visibility', () => { expect.anything(), expect.objectContaining({ id: 'child' }), false, + undefined, ); editorOverlay.unmount(); @@ -408,6 +409,12 @@ describe('UI tree preview visibility', () => { fireEvent.contextMenu( finalPreview.container.querySelector('[data-node-id="child"]')!, ); - expect(onNodeContextMenu).toHaveBeenCalledTimes(1); + expect(onNodeContextMenu).toHaveBeenCalledTimes(2); + expect(onNodeContextMenu).toHaveBeenLastCalledWith( + expect.anything(), + expect.objectContaining({ id: 'child' }), + false, + undefined, + ); }); });