校正预览上下文菜单测试
覆盖上下文菜单回调的可选树标识参数 区分编辑器树目标与最终预览的无树标识回调
This commit is contained in:
@@ -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,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user