forked from hazza/dspace-angular
62589: Added tests for more coverage
This commit is contained in:
@@ -123,4 +123,18 @@ describe('ItemSelectComponent', () => {
|
||||
expect(comp.confirm.emit).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
describe('when cancel is clicked', () => {
|
||||
let cancelButton: HTMLButtonElement;
|
||||
|
||||
beforeEach(() => {
|
||||
cancelButton = fixture.debugElement.query(By.css('button.item-cancel')).nativeElement;
|
||||
spyOn(comp.cancel, 'emit').and.callThrough();
|
||||
});
|
||||
|
||||
it('should emit a cancel event',() => {
|
||||
cancelButton.click();
|
||||
expect(comp.cancel.emit).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user