@edx/edx-proctoring
Advanced tools
Comparing version
@@ -177,2 +177,3 @@ (function(Backbone, $) { | ||
onboardingNotReleased: releaseDate > now, | ||
onboardingPastDue: data.onboarding_past_due, | ||
showOnboardingExamLink: this.shouldShowExamLink(data.onboarding_status), | ||
@@ -179,0 +180,0 @@ onboardingLink: data.onboarding_link, |
@@ -22,3 +22,4 @@ /* global LearnerOnboardingModel:false */ | ||
onboarding_release_date: releaseDate, | ||
expiration_date: null | ||
expiration_date: null, | ||
onboarding_past_due: false | ||
} | ||
@@ -70,3 +71,5 @@ ); | ||
'<% if (showOnboardingExamLink) { %>' + | ||
'<% if (onboardingNotReleased) { %>' + | ||
'<% if (onboardingPastDue) { %>' + | ||
'<a class="action action-onboarding action-disabled"><%= gettext("Onboarding Past Due") %></a>' + | ||
'<% } else if (onboardingNotReleased) { %>' + | ||
'<a class="action action-onboarding action-disabled">' + | ||
@@ -270,2 +273,39 @@ '<%= gettext("Onboarding Opens") %> <%= onboardingReleaseDate %></a>' + | ||
it('should render proctoring info panel correctly for past due exam', function() { | ||
var twoDaysAgo = new Date(); | ||
var data = { | ||
onboarding_status: status, | ||
onboarding_link: null, | ||
onboarding_release_date: twoDaysAgo, | ||
expiration_date: null, | ||
onboarding_past_due: true | ||
}; | ||
this.server.respondWith('GET', '/api/edx_proctoring/v1/user_onboarding/status?course_id=test_course_id', | ||
[ | ||
200, | ||
{ | ||
'Content-Type': 'application/json' | ||
}, | ||
JSON.stringify(data) | ||
] | ||
); | ||
this.proctored_exam_info = new edx.courseware.proctored_exam.ProctoredExamInfo({ | ||
el: $('.proctoring-info-panel'), | ||
model: new LearnerOnboardingModel() | ||
}); | ||
this.server.respond(); | ||
this.server.respond(); | ||
expect(this.proctored_exam_info.$el.find('.proctoring-info').css('border-top')) | ||
.toEqual('5px solid rgb(178, 6, 16)'); | ||
expect(this.proctored_exam_info.$el.find('.onboarding-status').html()) | ||
.toContain('Not Started'); | ||
expect(this.proctored_exam_info.$el.find('.onboarding-status-message').text()) | ||
.toHaveLength(0); | ||
expect(this.proctored_exam_info.$el.find('.onboarding-reminder').html()) | ||
.toContain('You must complete the onboarding process'); | ||
expect(this.proctored_exam_info.$el.find('.action-onboarding').html()) | ||
.toContain('Onboarding Past Due'); | ||
}); | ||
it('should render proctoring info panel correctly for created exam', function() { | ||
@@ -272,0 +312,0 @@ this.server.respondWith('GET', '/api/edx_proctoring/v1/user_onboarding/status?course_id=test_course_id', |
@@ -5,3 +5,3 @@ { | ||
"//": "Note that the version format is slightly different than that of the Python version when using prereleases.", | ||
"version": "3.10.2", | ||
"version": "3.11.0", | ||
"main": "edx_proctoring/static/index.js", | ||
@@ -8,0 +8,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
990134
0.25%18237
0.21%