Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
= Enea_Gore committed Nov 4, 2024
1 parent 1c82313 commit 9c9ac6d
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9c9ac6d

Please sign in to comment.