@edx/edx-proctoring
Advanced tools
Comparing version 3.9.0 to 3.9.2
@@ -41,2 +41,3 @@ describe('ProctoredExamAttemptView', function() { | ||
status: status, | ||
is_resumable: false, | ||
taking_as_proctored: true, | ||
@@ -95,5 +96,7 @@ proctored_exam: { | ||
function getExpectedGroupedProctoredExamAttemptWithAttemptStatusJson(status, isPracticeExam) { | ||
function getExpectedGroupedProctoredExamAttemptWithAttemptStatusJson(status, isPracticeExam, isResumable) { | ||
// eslint-disable-next-line no-param-reassign | ||
isPracticeExam = typeof isPracticeExam !== 'undefined' ? isPracticeExam : false; | ||
// eslint-disable-next-line no-param-reassign | ||
isResumable = typeof isResumable !== 'undefined' ? isResumable : false; | ||
return ( | ||
@@ -121,2 +124,3 @@ [{ | ||
status: status, | ||
is_resumable: isResumable, | ||
taking_as_proctored: true, | ||
@@ -153,2 +157,3 @@ proctored_exam: { | ||
status: status, | ||
is_resumable: isResumable, | ||
taking_as_proctored: true, | ||
@@ -185,2 +190,3 @@ proctored_exam: { | ||
status: 'resumed', | ||
is_resumable: false, | ||
taking_as_proctored: true, | ||
@@ -300,3 +306,3 @@ proctored_exam: { | ||
'<% if (' + | ||
'proctored_exam_attempt.status == "error" &&' + | ||
'proctored_exam_attempt.is_resumable &&' + | ||
'!proctored_exam_attempt.proctored_exam.is_practice_exam' + | ||
@@ -537,3 +543,3 @@ ') { %>' + | ||
}, | ||
JSON.stringify(getExpectedGroupedProctoredExamAttemptWithAttemptStatusJson('error')) | ||
JSON.stringify(getExpectedGroupedProctoredExamAttemptWithAttemptStatusJson('error', false, true)) | ||
] | ||
@@ -616,3 +622,3 @@ ); | ||
}, | ||
JSON.stringify(getExpectedGroupedProctoredExamAttemptWithAttemptStatusJson('error', true)) | ||
JSON.stringify(getExpectedGroupedProctoredExamAttemptWithAttemptStatusJson('error', true, true)) | ||
] | ||
@@ -634,2 +640,26 @@ ); | ||
it('should not display actions dropdown for exam attempts not resumable', function() { | ||
this.server.respondWith('GET', '/api/edx_proctoring/v1/proctored_exam/attempt/grouped/course_id/test_course_id', | ||
[ | ||
200, | ||
{ | ||
'Content-Type': 'application/json' | ||
}, | ||
JSON.stringify(getExpectedGroupedProctoredExamAttemptWithAttemptStatusJson('error', true, false)) | ||
] | ||
); | ||
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('tbody').html()).toContain('testuser1'); | ||
expect(this.proctored_exam_attempt_view.$el.find('tbody').html()).toContain('Normal Exam'); | ||
expect(this.proctored_exam_attempt_view.$el.find('tbody.accordion-panel').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); | ||
}); | ||
it('should display grouped attempts', function() { | ||
@@ -644,3 +674,3 @@ var rows; | ||
}, | ||
JSON.stringify(getExpectedGroupedProctoredExamAttemptWithAttemptStatusJson('error', false)) | ||
JSON.stringify(getExpectedGroupedProctoredExamAttemptWithAttemptStatusJson('error', false, true)) | ||
] | ||
@@ -677,3 +707,3 @@ ); | ||
}, | ||
JSON.stringify(getExpectedGroupedProctoredExamAttemptWithAttemptStatusJson('error', false)) | ||
JSON.stringify(getExpectedGroupedProctoredExamAttemptWithAttemptStatusJson('error', false, true)) | ||
] | ||
@@ -680,0 +710,0 @@ ); |
@@ -5,6 +5,6 @@ { | ||
"//": "Note that the version format is slightly different than that of the Python version when using prereleases.", | ||
"version": "3.9.0", | ||
"version": "3.9.2", | ||
"main": "edx_proctoring/static/index.js", | ||
"scripts":{ | ||
"test":"gulp test" | ||
"scripts": { | ||
"test": "gulp test" | ||
}, | ||
@@ -11,0 +11,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
986267
18197