From d94d1e93677e51017797f3129daf778756e51adf Mon Sep 17 00:00:00 2001 From: "swapnil.verma" Date: Mon, 18 Nov 2024 15:57:35 +0530 Subject: [PATCH] [ACA-4556] Added unit test --- .../content-node-selector-panel.component.spec.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/content-services/src/lib/content-node-selector/content-node-selector-panel/content-node-selector-panel.component.spec.ts b/lib/content-services/src/lib/content-node-selector/content-node-selector-panel/content-node-selector-panel.component.spec.ts index b5b81badd27..b23d87b1116 100644 --- a/lib/content-services/src/lib/content-node-selector/content-node-selector-panel/content-node-selector-panel.component.spec.ts +++ b/lib/content-services/src/lib/content-node-selector/content-node-selector-panel/content-node-selector-panel.component.spec.ts @@ -437,6 +437,19 @@ describe('ContentNodeSelectorPanelComponent', () => { expect(fakeNodePage.list.pagination.hasMoreItems).toBe(false); }); + it('should not update chosen node if currently selected location is within the DISABLE_ACTION_FOLDER_LIST property', () => { + const fakeNode = new Node({ + id: 'fake-node', + path: { elements: [{ nodeType: 'st:site', name: 'fake-site' }] } + }) as Node; + component.chosenNode = [fakeNode]; + component.documentList.currentFolderId = '-mysites-'; + component.documentList.folderNode = fakeFolderNode; + component.onFolderLoaded(nodePage); + expect(component.chosenNode).not.toEqual([fakeFolderNode]); + expect(component.chosenNode).toEqual([fakeNode]); + }); + describe('in the case when isSelectionValid is a custom function for checking permissions,', () => { beforeEach(() => { component.isSelectionValid = returnHasPermission;