mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[AAE-10320] Fix Content Service unit tests - 'has no expectations' (#7840)
* fix node action services unit tests * fix add permission panel units * fix some upload unit tests * fix some search unit tests * remove duplicated unit tests * [AAE-10320] fix content and document list unit tests * remove duplicated content node selector unit test * fix upload unit test
This commit is contained in:
@@ -468,32 +468,6 @@ describe('ContentNodeSelectorPanelComponent', () => {
|
||||
component.isSelectionValid = returnHasPermission;
|
||||
});
|
||||
|
||||
it('should NOT be null after selecting node with the necessary permissions', async () => {
|
||||
hasAllowableOperations = true;
|
||||
component.documentList.folderNode = entry;
|
||||
|
||||
component.select.subscribe((nodes) => {
|
||||
expect(nodes).toBeDefined();
|
||||
expect(nodes).not.toBeNull();
|
||||
expect(component.chosenNode[0]).toBe(entry);
|
||||
});
|
||||
|
||||
component.documentList.ready.emit(nodePage);
|
||||
});
|
||||
|
||||
it('should be null after selecting node without the necessary permissions', async () => {
|
||||
hasAllowableOperations = false;
|
||||
component.documentList.folderNode = entry;
|
||||
|
||||
component.select.subscribe((nodes) => {
|
||||
expect(nodes).toBeDefined();
|
||||
expect(nodes).toBeNull();
|
||||
expect(component.chosenNode).toBeNull();
|
||||
});
|
||||
|
||||
component.documentList.ready.emit(nodePage);
|
||||
});
|
||||
|
||||
it('should NOT be null after clicking on a node (with the right permissions) in the list (onNodeSelect)', async () => {
|
||||
hasAllowableOperations = true;
|
||||
|
||||
|
@@ -177,43 +177,19 @@ describe('ContentNodeSelectorComponent', () => {
|
||||
});
|
||||
|
||||
describe('Cancel button', () => {
|
||||
|
||||
it('should complete the data stream when user click "CANCEL"', () => {
|
||||
let cancelButton;
|
||||
data.select.subscribe(
|
||||
() => {
|
||||
},
|
||||
() => {
|
||||
},
|
||||
() => {
|
||||
cancelButton = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-actions-cancel"]'));
|
||||
expect(cancelButton).not.toBeNull();
|
||||
});
|
||||
|
||||
cancelButton = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-actions-cancel"]'));
|
||||
cancelButton.triggerEventHandler('click', {});
|
||||
});
|
||||
|
||||
it('should not be shown if dialogRef is NOT injected', () => {
|
||||
const closeButton = fixture.debugElement.query(By.css('[content-node-selector-actions-cancel]'));
|
||||
expect(closeButton).toBeNull();
|
||||
});
|
||||
|
||||
it('should close the dialog', () => {
|
||||
let cancelButton;
|
||||
data.select.subscribe(
|
||||
() => {
|
||||
},
|
||||
() => {
|
||||
},
|
||||
() => {
|
||||
cancelButton = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-actions-cancel"]'));
|
||||
expect(cancelButton).not.toBeNull();
|
||||
});
|
||||
|
||||
cancelButton = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-actions-cancel"]'));
|
||||
let cancelButton = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-actions-cancel"]'));
|
||||
cancelButton.triggerEventHandler('click', {});
|
||||
expect(dialog.close).toHaveBeenCalled();
|
||||
|
||||
fixture.detectChanges();
|
||||
cancelButton = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-actions-cancel"]'));
|
||||
expect(cancelButton).not.toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user