62589: Added tests for more coverage

This commit is contained in:
Kristof De Langhe
2019-09-30 10:35:52 +02:00
parent 145ed346c8
commit a2fb8a316b
6 changed files with 213 additions and 6 deletions

View File

@@ -101,4 +101,18 @@ describe('ItemSelectComponent', () => {
expect(comp.confirm.emit).toHaveBeenCalled();
});
});
describe('when cancel is clicked', () => {
let cancelButton: HTMLButtonElement;
beforeEach(() => {
cancelButton = fixture.debugElement.query(By.css('button.collection-cancel')).nativeElement;
spyOn(comp.cancel, 'emit').and.callThrough();
});
it('should emit a cancel event',() => {
cancelButton.click();
expect(comp.cancel.emit).toHaveBeenCalled();
});
});
});