diff --git a/src/test/javascript/spec/component/rating/rating.component.spec.ts b/src/test/javascript/spec/component/rating/rating.component.spec.ts index 694eafa02881..cab6a9d11e14 100644 --- a/src/test/javascript/spec/component/rating/rating.component.spec.ts +++ b/src/test/javascript/spec/component/rating/rating.component.spec.ts @@ -94,14 +94,12 @@ describe('RatingComponent', () => { ratingComponent.result.participation = { id: 1 } as Participation; jest.spyOn(ratingService, 'getRating').mockReturnValue(of(2)); ratingComponentFixture.detectChanges(); - ratingComponent.result = { id: 91 } as Result; - ratingComponentFixture.detectChanges(); - expect(loadRatingSpy).toHaveBeenCalledTimes(2); + expect(loadRatingSpy).toHaveBeenCalledOnce(); expect(ratingComponent.rating).toBe(2); }); it('should not call loadRating if result ID remains the same', () => { - // without this condition the loadRating might be spammed making unneccesary api calls + // without this condition the loadRating might be spammed making unnecessary api calls const loadRatingSpy = jest.spyOn(ratingComponent, 'loadRating'); ratingComponent.result = { id: 90 } as Result; ratingComponent.result.submission = { id: 1 } as Submission;