From 63a38ffbc736ff281a7aa2d527ac61ada31bb632 Mon Sep 17 00:00:00 2001 From: ilee2u Date: Thu, 7 Nov 2024 15:51:57 -0500 Subject: [PATCH 1/3] feat: hotfix to post-submit page for new ida --- src/instructions/RejectedInstructions.jsx | 2 ++ src/instructions/VerifiedInstructions.jsx | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/instructions/RejectedInstructions.jsx b/src/instructions/RejectedInstructions.jsx index 3c917a9c..50afd51b 100644 --- a/src/instructions/RejectedInstructions.jsx +++ b/src/instructions/RejectedInstructions.jsx @@ -12,6 +12,8 @@ const RejectedExamInstructions = ({ examType }) => { switch (examType) { case ExamType.PROCTORED: return ; + case ExamType.PRACTICE: + return ; case ExamType.ONBOARDING: return ; default: diff --git a/src/instructions/VerifiedInstructions.jsx b/src/instructions/VerifiedInstructions.jsx index 6c9f1c10..0f85dd74 100644 --- a/src/instructions/VerifiedInstructions.jsx +++ b/src/instructions/VerifiedInstructions.jsx @@ -11,6 +11,8 @@ const VerifiedExamInstructions = ({ examType }) => { switch (examType) { case ExamType.ONBOARDING: return ; + case ExamType.PRACTICE: + return ; case ExamType.PROCTORED: return ; default: From 853a57ca0de4492859b735be6ed31c5d0e5d7819 Mon Sep 17 00:00:00 2001 From: ilee2u Date: Thu, 7 Nov 2024 16:00:00 -0500 Subject: [PATCH 2/3] chore: fix switch case ordering --- src/instructions/VerifiedInstructions.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/instructions/VerifiedInstructions.jsx b/src/instructions/VerifiedInstructions.jsx index 0f85dd74..bedbe374 100644 --- a/src/instructions/VerifiedInstructions.jsx +++ b/src/instructions/VerifiedInstructions.jsx @@ -9,12 +9,12 @@ import Footer from './proctored_exam/Footer'; const VerifiedExamInstructions = ({ examType }) => { const renderInstructions = () => { switch (examType) { - case ExamType.ONBOARDING: - return ; - case ExamType.PRACTICE: - return ; case ExamType.PROCTORED: return ; + case ExamType.PRACTICE: + return ; + case ExamType.ONBOARDING: + return ; default: return null; } From 8938d2f02085fd3df1e166784a38ab82d0d8b97c Mon Sep 17 00:00:00 2001 From: ilee2u Date: Tue, 12 Nov 2024 13:10:26 -0500 Subject: [PATCH 3/3] test: add tests for practice exam --- src/instructions/Instructions.test.jsx | 51 ++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/src/instructions/Instructions.test.jsx b/src/instructions/Instructions.test.jsx index c0c9bdf8..5f7b73a3 100644 --- a/src/instructions/Instructions.test.jsx +++ b/src/instructions/Instructions.test.jsx @@ -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( + +
Sequence
+
, + { 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: 'test@example.com' })).toHaveTextContent('test@example.com'); }); + 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: 'test@example.com', + }), + activeAttempt: {}, + exam: Factory.build('exam', { + is_proctored: true, + type: ExamType.PRACTICE, + attempt: Factory.build('attempt', { + attempt_status: ExamStatus.VERIFIED, + }), + }), + }), + }); + + render( + +
Sequence
+
, + { 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', {