From cf4e5305f4c5b977bb9702918858a08cdce62f76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81d=C3=A1m=20Hassan?= Date: Tue, 21 Nov 2023 11:16:57 +0100 Subject: [PATCH] unit test fix --- .../src/components/picker/picker-helper.tsx | 2 +- .../sn-pickers-react/tests/picker.test.tsx | 42 ------------------- 2 files changed, 1 insertion(+), 43 deletions(-) diff --git a/packages/sn-pickers-react/src/components/picker/picker-helper.tsx b/packages/sn-pickers-react/src/components/picker/picker-helper.tsx index 3b4e25004..3f5e948c1 100644 --- a/packages/sn-pickers-react/src/components/picker/picker-helper.tsx +++ b/packages/sn-pickers-react/src/components/picker/picker-helper.tsx @@ -56,7 +56,7 @@ export const PickerHelper = ({ handleJumpToCurrentPath(contextPath || '')} + onClick={() => handleJumpToCurrentPath(contextPath)} className={styles}> {currentContentText || 'Current Content'} diff --git a/packages/sn-pickers-react/tests/picker.test.tsx b/packages/sn-pickers-react/tests/picker.test.tsx index f7f087a1c..7c5453a10 100644 --- a/packages/sn-pickers-react/tests/picker.test.tsx +++ b/packages/sn-pickers-react/tests/picker.test.tsx @@ -417,48 +417,6 @@ describe('Picker component', () => { wrapper.update() }) - it('should handle distinct SelectionRoots', async () => { - const loadCollection = () => ({ - d: { - results: [ - { - Id: 10, - Type: 'Folder', - Path: '/Root/Content', - Name: 'SampleWorkspace', - DisplayName: 'Sample Workspace', - }, - ], - }, - }) - const load = jest.fn() - const onTreeNavigation = jest.fn() - - let wrapper: any - await act(async () => { - wrapper = mount( - , - ) - }) - - wrapper.update() - - await act(async () => wrapper.update().find(ListItem).at(0).simulate('dblclick')) - - expect(onTreeNavigation).toHaveBeenCalledWith('!VirtualRoot!') - - expect(load).toHaveBeenCalledWith({ idOrPath: '/Root/Content', oDataOptions: undefined }) - expect(load).toHaveBeenCalledWith({ - idOrPath: '/Root/IMS/Public', - oDataOptions: undefined, - }) - }) - it('should render helper Current Conten based on SelectionRoot', async () => { let helperItems = { Id: 1, Name: 'Item1', DisplayName: 'Display Item1', Path: '/Root/Content/EN/Blog/Posts' }