Commit e58813be by Mushtaq Ali

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
parent 0332ebea
......@@ -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);
......
......@@ -30,7 +30,7 @@
<div class="instruction <% if ( !upgrade && isActive ) { %>center-col<% } %>">
<% if ( _.some( requirements, function( isVisible ) { return isVisible; } ) ) { %>
<p class="instruction-info">
<% 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 }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment