-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: hotfix to post-submit page for new ida (#157)
* feat: hotfix to post-submit page for new ida * chore: fix switch case ordering * test: add tests for practice exam
- Loading branch information
Showing
3 changed files
with
57 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -364,6 +364,29 @@ describe('SequenceExamWrapper', () => { | |
} | ||
}); | ||
|
||
it('Shows correct rejected practice exam instructions when attempt is rejected', () => { | ||
store.getState = () => ({ | ||
specialExams: Factory.build('specialExams', { | ||
exam: Factory.build('exam', { | ||
is_proctored: true, | ||
type: ExamType.PRACTICE, | ||
attempt: Factory.build('attempt', { | ||
attempt_status: ExamStatus.REJECTED, | ||
}), | ||
}), | ||
}), | ||
}); | ||
|
||
const { queryByTestId } = render( | ||
<Instructions> | ||
<div>Sequence</div> | ||
</Instructions>, | ||
{ store }, | ||
); | ||
|
||
expect(queryByTestId('proctored-exam-instructions-title')).toBeInTheDocument(); | ||
}); | ||
|
||
it('Shows submit onboarding exam instructions if exam is onboarding and attempt status is ready_to_submit', () => { | ||
store.getState = () => ({ | ||
specialExams: Factory.build('specialExams', { | ||
|
@@ -477,6 +500,34 @@ describe('SequenceExamWrapper', () => { | |
expect(screen.getByRole('link', { name: '[email protected]' })).toHaveTextContent('[email protected]'); | ||
}); | ||
|
||
it('Shows verified practice exam instructions if exam is practice and attempt status is verified', () => { | ||
store.getState = () => ({ | ||
specialExams: Factory.build('specialExams', { | ||
proctoringSettings: Factory.build('proctoringSettings', { | ||
integration_specific_email: '[email protected]', | ||
}), | ||
activeAttempt: {}, | ||
exam: Factory.build('exam', { | ||
is_proctored: true, | ||
type: ExamType.PRACTICE, | ||
attempt: Factory.build('attempt', { | ||
attempt_status: ExamStatus.VERIFIED, | ||
}), | ||
}), | ||
}), | ||
}); | ||
|
||
render( | ||
<Instructions> | ||
<div>Sequence</div> | ||
</Instructions>, | ||
{ store }, | ||
); | ||
|
||
expect(screen.getByText('Your proctoring session was reviewed successfully. A final grade will be available soon.')).toBeInTheDocument(); | ||
expect(screen.getByTestId('proctored-exam-instructions-title')).toBeInTheDocument(); | ||
}); | ||
|
||
it('Shows error practice exam instructions if exam is onboarding and attempt status is error', () => { | ||
store.getState = () => ({ | ||
specialExams: Factory.build('specialExams', { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters