From 01208a9f9a1d38c9ccf04a354205ed99c2a40ff4 Mon Sep 17 00:00:00 2001 From: alangsto <46360176+alangsto@users.noreply.github.com> Date: Tue, 30 Mar 2021 09:34:55 -0400 Subject: [PATCH] prevent frontend errors for escalation email if proctoring is disabled (#61) --- .../ProctoredExamSettings.jsx | 4 +- .../ProctoredExamSettings.test.jsx | 47 +++++++++++++++++++ 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/src/proctored-exam-settings/ProctoredExamSettings.jsx b/src/proctored-exam-settings/ProctoredExamSettings.jsx index d7eb93824..b60750587 100644 --- a/src/proctored-exam-settings/ProctoredExamSettings.jsx +++ b/src/proctored-exam-settings/ProctoredExamSettings.jsx @@ -108,7 +108,7 @@ function ProctoredExamSettings({ courseId, intl }) { function handleSubmit(event) { event.preventDefault(); - if (proctoringProvider === 'proctortrack' && !EmailValidator.validate(proctortrackEscalationEmail)) { + if (proctoringProvider === 'proctortrack' && !EmailValidator.validate(proctortrackEscalationEmail) && !(proctortrackEscalationEmail === '' && !enableProctoredExams)) { if (proctortrackEscalationEmail === '') { const errorMessage = intl.formatMessage(messages['authoring.examsettings.escalationemail.error.blank']); @@ -192,7 +192,7 @@ function ProctoredExamSettings({ courseId, intl }) { function renderContent() { return (