@edx/edx-proctoring
Advanced tools
Comparing version 3.17.0 to 3.17.1
@@ -205,3 +205,10 @@ edx = edx || {}; | ||
data = $.parseJSON(response.responseText); | ||
try { | ||
data = $.parseJSON(response.responseText); | ||
} catch (error) { | ||
data = { | ||
detail: 'An unexpected error occured. Please try again later.' | ||
}; | ||
} | ||
if (data.detail) { | ||
@@ -208,0 +215,0 @@ $errorResponse = $('#error-response'); |
@@ -448,2 +448,26 @@ describe('ProctoredExamOnboardingView', function() { | ||
}); | ||
it('renders correctly with non-JSON parseable error message response', function() { | ||
var errorMessage; | ||
this.server.respondWith('GET', '/api/edx_proctoring/v1/user_onboarding/status/course_id/test_course_id', | ||
[ | ||
500, | ||
{ | ||
'Content-Type': 'application/json' | ||
}, | ||
'' | ||
] | ||
); | ||
this.proctored_exam_onboarding_view = new edx.instructor_dashboard.proctoring.ProctoredExamOnboardingView(); | ||
this.server.respond(); | ||
this.server.respond(); | ||
errorMessage = this.proctored_exam_onboarding_view.$el.find('.error-response'); | ||
expect(errorMessage.html()).toContain('An unexpected error occured. Please try again later.'); | ||
expect(errorMessage).toBeVisible(); | ||
expect(this.proctored_exam_onboarding_view.$el.find('.onboarding-status-content')).not.toBeVisible(); | ||
}); | ||
}); |
@@ -5,3 +5,3 @@ { | ||
"//": "Note that the version format is slightly different than that of the Python version when using prereleases.", | ||
"version": "3.17.0", | ||
"version": "3.17.1", | ||
"main": "edx_proctoring/static/index.js", | ||
@@ -8,0 +8,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
999482
18360