Skip to content

Commit

Permalink
[ACA-4556] Added unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
swapnil-verma-gl committed Nov 18, 2024
1 parent 6673a0b commit d94d1e9
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d94d1e9

Please sign in to comment.