Fix SubmissionSectionUploadFileComponent no expectation tests

The fixture.whenStable() was not awaited
This commit is contained in:
Alexandre Vryghem
2023-07-01 14:19:15 +02:00
parent a524805faf
commit b83a0b3f9b

View File

@@ -180,7 +180,7 @@ describe('SubmissionSectionUploadFileComponent test suite', () => {
expect(comp.fileData).toEqual(fileData);
});
it('should call deleteFile on delete confirmation', () => {
it('should call deleteFile on delete confirmation', async () => {
spyOn(compAsAny, 'deleteFile');
comp.fileData = fileData;
@@ -196,9 +196,8 @@ describe('SubmissionSectionUploadFileComponent test suite', () => {
fixture.detectChanges();
fixture.whenStable().then(() => {
expect(compAsAny.deleteFile).toHaveBeenCalled();
});
await fixture.whenStable();
expect(compAsAny.deleteFile).toHaveBeenCalled();
});
it('should delete file properly', () => {