[Task 72956] improvement to the spyOn in EPersonFormComponent test

This commit is contained in:
Raf Ponsaerts
2020-09-21 14:56:29 +02:00
parent 2d2fb0210c
commit f8dab74b64

View File

@@ -319,7 +319,7 @@ describe('EPersonFormComponent', () => {
it ('should call the epersonService delete when clicked on the button' , () => { it ('should call the epersonService delete when clicked on the button' , () => {
// ePersonDataServiceStub.activeEPerson = eperson; // ePersonDataServiceStub.activeEPerson = eperson;
spyOn(component.epersonService, 'deleteEPerson').and.stub(); spyOn(component.epersonService, 'deleteEPerson').and.returnValue(observableOf(new RestResponse(true, 204, 'No Content')));
const deleteButton = fixture.debugElement.query(By.css('.delete-button')); const deleteButton = fixture.debugElement.query(By.css('.delete-button'));
expect(deleteButton.nativeElement.disabled).toBe(false); expect(deleteButton.nativeElement.disabled).toBe(false);
deleteButton.triggerEventHandler('click', null); deleteButton.triggerEventHandler('click', null);