@edx/edx-proctoring
Advanced tools
Comparing version 3.4.0 to 3.4.1
@@ -16,3 +16,5 @@ describe('ProctoredExamAttemptView', function() { | ||
}]; | ||
function getExpectedProctoredExamAttemptWithAttemptStatusJson(status) { | ||
function getExpectedProctoredExamAttemptWithAttemptStatusJson(status, isPracticeExam) { | ||
// eslint-disable-next-line no-param-reassign | ||
isPracticeExam = typeof isPracticeExam !== 'undefined' ? isPracticeExam : false; | ||
return ( | ||
@@ -48,3 +50,3 @@ [{ | ||
is_active: true, | ||
is_practice_exam: false, | ||
is_practice_exam: isPracticeExam, | ||
is_proctored: true, | ||
@@ -129,3 +131,6 @@ time_limit_mins: 1 | ||
'<% if (enable_exam_resume_proctoring_improvements) { %>' + | ||
'<% if (proctored_exam_attempt.status == "error") { %>' + | ||
'<% if (' + | ||
'proctored_exam_attempt.status == "error" &&' + | ||
'!proctored_exam_attempt.proctored_exam.is_practice_exam' + | ||
') { %>' + | ||
'<div class="wrapper-action-more">' + | ||
@@ -461,2 +466,30 @@ '<button class="action action-more" type="button" id="actions-dropdown-link-<%= dashboard_index %>"' + | ||
}); | ||
it('should not display actions dropdown for practice exam attempts', function() { | ||
// enable the dropdown via the enable-exam-resume-proctoring-improvements data attribute | ||
setFixtures('<div class="student-proctored-exam-container" data-course-id="test_course_id" ' + | ||
'data-enable-exam-resume-proctoring-improvements="True"></div>'); | ||
this.server.respondWith('GET', '/api/edx_proctoring/v1/proctored_exam/attempt/course_id/test_course_id', | ||
[ | ||
200, | ||
{ | ||
'Content-Type': 'application/json' | ||
}, | ||
JSON.stringify(getExpectedProctoredExamAttemptWithAttemptStatusJson('error', true)) | ||
] | ||
); | ||
this.proctored_exam_attempt_view = new edx.instructor_dashboard.proctoring.ProctoredExamAttemptView(); | ||
// Process all requests so far | ||
this.server.respond(); | ||
this.server.respond(); | ||
expect(this.proctored_exam_attempt_view.$el.find('tr.allowance-items')).toContainHtml('<td> testuser1 </td>'); | ||
expect(this.proctored_exam_attempt_view.$el.find('tr.allowance-items').html()).toContain('Normal Exam'); | ||
expect(this.proctored_exam_attempt_view.$el.find('tr.allowance-items').html()).toContain('error'); | ||
expect(this.proctored_exam_attempt_view.$el.find('button.action').html()).toHaveLength(0); | ||
expect(this.proctored_exam_attempt_view.$el.find('.actions-dropdown').html()).toHaveLength(0); | ||
}); | ||
}); |
@@ -5,3 +5,3 @@ { | ||
"//": "Note that the version format is slightly different than that of the Python version when using prereleases.", | ||
"version": "3.4.0", | ||
"version": "3.4.1", | ||
"main": "edx_proctoring/static/index.js", | ||
@@ -8,0 +8,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
934812
17402