mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-3670] Checklist - fix failing unit test (#3873)
* fix unit test on checklist * Fix relative path import
This commit is contained in:
committed by
Eugenio Romano
parent
94df1f6fdd
commit
29f28c7c82
@@ -205,25 +205,26 @@ describe('ChecklistComponent', () => {
|
||||
});
|
||||
}));
|
||||
|
||||
it('should send an event when the checklist is deleted', (done) => {
|
||||
it('should send an event when the checklist is deleted', async(() => {
|
||||
spyOn(service, 'deleteTask').and.returnValue(of(''));
|
||||
let disposableDelete = checklistComponent.checklistTaskDeleted.subscribe(() => {
|
||||
expect(element.querySelector('#fake-check-id')).toBeNull();
|
||||
disposableDelete.unsubscribe();
|
||||
done();
|
||||
});
|
||||
|
||||
checklistComponent.taskId = 'new-fake-task-id';
|
||||
checklistComponent.checklist.push(new TaskDetailsModel({
|
||||
id: 'fake-check-id',
|
||||
name: 'fake-check-name'
|
||||
}));
|
||||
|
||||
fixture.detectChanges();
|
||||
let checklistElementRemove = <HTMLElement> element.querySelector('#remove-fake-check-id');
|
||||
expect(checklistElementRemove).toBeDefined();
|
||||
expect(checklistElementRemove).not.toBeNull();
|
||||
checklistElementRemove.click();
|
||||
});
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
expect(checklistComponent.checklist.length).toBe(1);
|
||||
let checklistElementRemove = <HTMLElement> element.querySelector('#remove-fake-check-id');
|
||||
expect(checklistElementRemove).toBeDefined();
|
||||
expect(checklistElementRemove).not.toBeNull();
|
||||
checklistElementRemove.click();
|
||||
|
||||
expect(checklistComponent.checklist.length).toBe(0);
|
||||
});
|
||||
}));
|
||||
|
||||
it('should show load task checklist on change', async(() => {
|
||||
|
||||
|
Reference in New Issue
Block a user