Skip to content

Commit

Permalink
fix client tests
Browse files Browse the repository at this point in the history
  • Loading branch information
krusche committed Oct 13, 2024
1 parent 494e40d commit 2bc0433
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('RequestFeedbackButtonComponent', () => {
submissions: [{ id: 1, submitted: true }],
testRun: false,
} as StudentParticipation;
const exercise = { id: 1, type: ExerciseType.TEXT, course: undefined, studentParticipations: [participation] } as Exercise;
const exercise = { id: 1, type: ExerciseType.TEXT, course: undefined, studentParticipations: [participation], allowFeedbackRequests: true } as Exercise;
fixture.componentRef.setInput('exercise', exercise);
mockExerciseDetails(exercise);

Expand All @@ -75,7 +75,7 @@ describe('RequestFeedbackButtonComponent', () => {

it('should display the button when Athena is enabled and it is not an exam exercise', fakeAsync(() => {
setAthenaEnabled(true);
const exercise = { id: 1, type: ExerciseType.TEXT, course: {} } as Exercise; // course undefined means exam exercise
const exercise = { id: 1, type: ExerciseType.TEXT, course: {}, allowFeedbackRequests: true } as Exercise; // course undefined means exam exercise
fixture.componentRef.setInput('exercise', exercise);
mockExerciseDetails(exercise);

Expand Down Expand Up @@ -104,7 +104,7 @@ describe('RequestFeedbackButtonComponent', () => {

it('should disable the button when participation is missing', fakeAsync(() => {
setAthenaEnabled(true);
const exercise = { id: 1, type: ExerciseType.TEXT, course: {}, studentParticipations: undefined } as Exercise;
const exercise = { id: 1, type: ExerciseType.TEXT, course: {}, studentParticipations: undefined, allowFeedbackRequests: true } as Exercise;
fixture.componentRef.setInput('exercise', exercise);
mockExerciseDetails(exercise);

Expand All @@ -123,7 +123,7 @@ describe('RequestFeedbackButtonComponent', () => {
id: 1,
submissions: [{ id: 1, submitted: true }],
} as StudentParticipation;
const exercise = { id: 1, type: ExerciseType.TEXT, course: {}, studentParticipations: [participation] } as Exercise;
const exercise = { id: 1, type: ExerciseType.TEXT, course: {}, studentParticipations: [participation], allowFeedbackRequests: true } as Exercise;
fixture.componentRef.setInput('exercise', exercise);
component.isExamExercise = false;
mockExerciseDetails(exercise);
Expand All @@ -146,7 +146,7 @@ describe('RequestFeedbackButtonComponent', () => {
submissions: [{ id: 1, submitted: false }],
testRun: false,
} as StudentParticipation;
const exercise = { id: 1, type: ExerciseType.PROGRAMMING, studentParticipations: [participation], course: {} } as Exercise;
const exercise = { id: 1, type: ExerciseType.PROGRAMMING, studentParticipations: [participation], course: {}, allowFeedbackRequests: true } as Exercise;
fixture.componentRef.setInput('exercise', exercise);

mockExerciseDetails(exercise);
Expand All @@ -173,7 +173,7 @@ describe('RequestFeedbackButtonComponent', () => {
it('should show an alert when requestFeedback() is called and conditions are not satisfied', fakeAsync(() => {
setAthenaEnabled(true);

const exercise = { id: 1, type: ExerciseType.TEXT, course: {} } as Exercise;
const exercise = { id: 1, type: ExerciseType.TEXT, course: {}, allowFeedbackRequests: true } as Exercise;
fixture.componentRef.setInput('exercise', exercise);

jest.spyOn(component, 'hasAthenaResultForLatestSubmission').mockReturnValue(true);
Expand All @@ -191,7 +191,7 @@ describe('RequestFeedbackButtonComponent', () => {
submissions: [{ id: 1, submitted: false }],
testRun: false,
} as StudentParticipation;
const exercise = { id: 1, type: ExerciseType.TEXT, studentParticipations: [participation], course: {} } as Exercise;
const exercise = { id: 1, type: ExerciseType.TEXT, studentParticipations: [participation], course: {}, allowFeedbackRequests: true } as Exercise;
fixture.componentRef.setInput('exercise', exercise);
fixture.componentRef.setInput('isGeneratingFeedback', false);
mockExerciseDetails(exercise);
Expand All @@ -212,7 +212,7 @@ describe('RequestFeedbackButtonComponent', () => {
submissions: [{ id: 1, submitted: true }],
testRun: false,
} as StudentParticipation;
const exercise = { id: 1, type: ExerciseType.TEXT, course: {}, studentParticipations: [participation] } as Exercise;
const exercise = { id: 1, type: ExerciseType.TEXT, course: {}, studentParticipations: [participation], allowFeedbackRequests: true } as Exercise;
fixture.componentRef.setInput('exercise', exercise);
fixture.componentRef.setInput('isGeneratingFeedback', false);
mockExerciseDetails(exercise);
Expand Down

0 comments on commit 2bc0433

Please sign in to comment.