diff --git a/src/courseware/course/chat/Chat.jsx b/src/courseware/course/chat/Chat.jsx index afeacccd1b..cddfbc1ddf 100644 --- a/src/courseware/course/chat/Chat.jsx +++ b/src/courseware/course/chat/Chat.jsx @@ -24,17 +24,10 @@ const Chat = ({ 'paid-bootcamp', ]; - const AUDIT_MODES = [ - 'audit', - 'honor', - 'unpaid-executive-education', - 'unpaid-bootcamp', - ]; - - const isEnrolled = ( + const hasVerifiedEnrollment = ( enrollmentMode !== null && enrollmentMode !== undefined - && [...VERIFIED_MODES, ...AUDIT_MODES].some(mode => mode === enrollmentMode) + && [...VERIFIED_MODES].some(mode => mode === enrollmentMode) ); const endDatePassed = () => { @@ -46,7 +39,7 @@ const Chat = ({ const shouldDisplayChat = ( enabled - && (isEnrolled || isStaff) // display only to enrolled or staff + && (hasVerifiedEnrollment || isStaff) // display only to verified learners or staff && !endDatePassed() ); diff --git a/src/courseware/course/chat/Chat.test.jsx b/src/courseware/course/chat/Chat.test.jsx index 3045559b11..31085c54df 100644 --- a/src/courseware/course/chat/Chat.test.jsx +++ b/src/courseware/course/chat/Chat.test.jsx @@ -16,9 +16,9 @@ let enabledTestCases = []; let disabledTestCases = []; const enabledModes = [ 'professional', 'verified', 'no-id-professional', 'credit', 'masters', 'executive-education', - 'paid-executive-education', 'paid-bootcamp', 'audit', 'honor', 'unpaid-executive-education', 'unpaid-bootcamp', + 'paid-executive-education', 'paid-bootcamp', ]; -const disabledModes = [null, undefined, 'xyz']; +const disabledModes = [null, undefined, 'xyz', 'audit', 'honor', 'unpaid-executive-education', 'unpaid-bootcamp']; const currentTime = new Date(); describe('Chat', () => {