Skip to content

Commit

Permalink
add triggersave test to modeling test
Browse files Browse the repository at this point in the history
  • Loading branch information
edkaya committed Oct 26, 2024
1 parent 6722606 commit f588a00
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ describe('ModelingExamSubmissionComponent', () => {
expect(directiveInstance.translateValues).toEqual({ points: maxScore, bonusPoints: bonusPoints });
});

it('should call triggerSave if save exercise button is clicked', () => {
fixture.detectChanges();
const saveExerciseSpy = jest.spyOn(comp, 'notifyTriggerSave');
const saveButton = fixture.debugElement.query(By.directive(ExerciseSaveButtonComponent));
saveButton.triggerEventHandler('save', null);
expect(saveExerciseSpy).toHaveBeenCalledOnce();
});

it('should show modeling editor with correct props when there is submission and exercise', () => {
fixture.detectChanges();
const modelingEditor = fixture.debugElement.query(By.directive(ModelingEditorComponent));
Expand Down

0 comments on commit f588a00

Please sign in to comment.