From e58813be795c9432d86a383850ee3854382928ba Mon Sep 17 00:00:00 2001 From: Mushtaq Ali Date: Mon, 18 Jul 2016 15:51:33 +0500 Subject: [PATCH] Show user activation message if he has activation incomplete. Only show validation deadline message when user is activated and course has validation deadline. ECOM-4926 --- .../make_payment_step_view_spec.js | 35 +++++++++++++++++++ .../make_payment_step.underscore | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/lms/static/js/spec/verify_student/make_payment_step_view_spec.js b/lms/static/js/spec/verify_student/make_payment_step_view_spec.js index e3370e62ba..85fe93d5ca 100644 --- a/lms/static/js/spec/verify_student/make_payment_step_view_spec.js +++ b/lms/static/js/spec/verify_student/make_payment_step_view_spec.js @@ -142,6 +142,41 @@ define([ expectPaymentSubmitted( view, {foo: 'bar'} ); }); + it ('view containing verification msg when verification deadline is set and user is active', function() { + var verificationDeadlineDateFormat = 'Aug 14, 2016 at 23:59 UTC'; + createView({ + userEmail: 'test@example.com', + requirements: { + isVisible:true + }, + verificationDeadline: verificationDeadlineDateFormat, + isActive: true + }); + // Verify user does not get user activation message when he is already activated. + expect($('p.instruction-info:contains("test@example.com")').length).toEqual(0); + // Verify user gets verification message. + expect( + $( + 'p.instruction-info:contains("You can pay now even if you don\'t have ' + + 'the following items available, but you will need to have these by ' + + verificationDeadlineDateFormat + ' to qualify to earn a Verified Certificate.")' + ).length + ).toEqual(1); + }); + + it ('view containing user email when verification deadline is set and user is not active', function() { + createView({ + userEmail: 'test@example.com', + requirements: { + isVisible:true + }, + verificationDeadline: true, + isActive: false + }); + // Verify un-activated user gets activation message. + expect($('p.instruction-info:contains("test@example.com")').length).toEqual(1); + }); + it ('view containing user email', function() { createView({userEmail: 'test@example.com', requirements: {isVisible:true}, isActive: false}); expect($('p.instruction-info:contains("test@example.com")').length).toEqual(1); diff --git a/lms/templates/verify_student/make_payment_step.underscore b/lms/templates/verify_student/make_payment_step.underscore index 86f61ab516..e0ec692e42 100644 --- a/lms/templates/verify_student/make_payment_step.underscore +++ b/lms/templates/verify_student/make_payment_step.underscore @@ -30,7 +30,7 @@
<% if ( _.some( requirements, function( isVisible ) { return isVisible; } ) ) { %>

- <% if ( verificationDeadline ) { %> + <% if ( verificationDeadline && isActive) { %> <%- _.sprintf( gettext( "You can pay now even if you don't have the following items available, but you will need to have these by %(date)s to qualify to earn a Verified Certificate." ), { date: verificationDeadline }