@@ -739,8 +739,8 @@ describe('Program Details View', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('should render appropriate subscription text when subscription is active with trial', () => {
|
||||
testSubscriptionState(
|
||||
it('should not render appropriate subscription text when subscription is active with trial', () => {
|
||||
testSubscriptionSunsetting(
|
||||
'active',
|
||||
'Manage my subscription',
|
||||
'Trial ends',
|
||||
@@ -748,8 +748,8 @@ describe('Program Details View', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('should render appropriate subscription text when subscription is active', () => {
|
||||
testSubscriptionState(
|
||||
it('should not render appropriate subscription text when subscription is active', () => {
|
||||
testSubscriptionSunsetting(
|
||||
'active',
|
||||
'Manage my subscription',
|
||||
'Your next billing date is',
|
||||
|
||||
@@ -46,64 +46,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
||||
<% if (isSubscriptionEligible && (
|
||||
completedCount !== totalCount
|
||||
|| subscriptionState === 'active'
|
||||
)
|
||||
) { %>
|
||||
<div class="d-flex flex-column align-items-start flex-xl-row align-items-xl-center upgrade-subscription">
|
||||
<a
|
||||
href="<%- subscriptionUrl %>"
|
||||
class="js-subscription-cta btn-brand btn cta-primary upgrade-button"
|
||||
<% if (subscriptionState === 'active') { %>
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
<% } %>
|
||||
>
|
||||
<% if (subscriptionState === 'active') { %>
|
||||
<div class="d-flex align-items-center">
|
||||
<span><%- gettext('Manage my subscription') %></span>
|
||||
<div class="subscription-icon-launch">
|
||||
<% // xss-lint: disable=underscore-not-escaped %>
|
||||
<%= launchIcon %>
|
||||
</div>
|
||||
</div>
|
||||
<% } else if (subscriptionState === 'inactive') { %>
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="subscription-icon-restart">
|
||||
<% // xss-lint: disable=underscore-not-escaped %>
|
||||
<%= restartIcon %>
|
||||
</div>
|
||||
<span><%- gettext('Restart my subscription') %></span>
|
||||
</div>
|
||||
<% } else { %>
|
||||
<%- StringUtils.interpolate(
|
||||
gettext('Start {trialLength}-day free trial'),
|
||||
{ trialLength }
|
||||
) %>
|
||||
<% } %>
|
||||
</a>
|
||||
<span class="subscription-info-brief">
|
||||
<%- StringUtils.interpolate(
|
||||
(
|
||||
hasActiveTrial
|
||||
? gettext('Trial ends {trialEndDate} at {trialEndTime}')
|
||||
: subscriptionState === 'active'
|
||||
? gettext('Your next billing date is {currentPeriodEnd}')
|
||||
: subscriptionState === 'inactive'
|
||||
? gettext('{subscriptionPrice} subscription. Cancel anytime.')
|
||||
: gettext('{subscriptionPrice} subscription after trial ends. Cancel anytime.')
|
||||
),
|
||||
{
|
||||
subscriptionPrice,
|
||||
currentPeriodEnd,
|
||||
trialEndDate,
|
||||
trialEndTime,
|
||||
}
|
||||
) %>
|
||||
</span>
|
||||
</div>
|
||||
<% } else if (
|
||||
<% if (
|
||||
!isSubscriptionEligible
|
||||
&& is_learner_eligible_for_one_click_purchase
|
||||
&& (typeof is_mobile_only === 'undefined' || is_mobile_only === false)
|
||||
|
||||
@@ -21,64 +21,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
||||
<% if (isSubscriptionEligible && (
|
||||
completedCount !== totalCount
|
||||
|| subscriptionState === 'active'
|
||||
)
|
||||
) { %>
|
||||
<div class="d-flex flex-column align-items-start flex-xl-row align-items-xl-center upgrade-subscription">
|
||||
<a
|
||||
href="<%- subscriptionUrl %>"
|
||||
class="js-subscription-cta btn-brand btn cta-primary upgrade-button"
|
||||
<% if (subscriptionState === 'active') { %>
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
<% } %>
|
||||
>
|
||||
<% if (subscriptionState === 'active') { %>
|
||||
<div class="d-flex align-items-center">
|
||||
<span><%- gettext('Manage my subscription') %></span>
|
||||
<div class="subscription-icon-launch">
|
||||
<% // xss-lint: disable=underscore-not-escaped %>
|
||||
<%= launchIcon %>
|
||||
</div>
|
||||
</div>
|
||||
<% } else if (subscriptionState === 'inactive') { %>
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="subscription-icon-restart">
|
||||
<% // xss-lint: disable=underscore-not-escaped %>
|
||||
<%= restartIcon %>
|
||||
</div>
|
||||
<span><%- gettext('Restart my subscription') %></span>
|
||||
</div>
|
||||
<% } else { %>
|
||||
<%- StringUtils.interpolate(
|
||||
gettext('Start {trialLength}-day free trial'),
|
||||
{ trialLength }
|
||||
) %>
|
||||
<% } %>
|
||||
</a>
|
||||
<span class="subscription-info-brief">
|
||||
<%- StringUtils.interpolate(
|
||||
(
|
||||
hasActiveTrial
|
||||
? gettext('Trial ends {trialEndDate} at {trialEndTime}')
|
||||
: subscriptionState === 'active'
|
||||
? gettext('Your next billing date is {currentPeriodEnd}')
|
||||
: subscriptionState === 'inactive'
|
||||
? gettext('{subscriptionPrice} subscription. Cancel anytime.')
|
||||
: gettext('{subscriptionPrice} subscription after trial ends. Cancel anytime.')
|
||||
),
|
||||
{
|
||||
subscriptionPrice,
|
||||
currentPeriodEnd,
|
||||
trialEndDate,
|
||||
trialEndTime,
|
||||
}
|
||||
) %>
|
||||
</span>
|
||||
</div>
|
||||
<% } else if (
|
||||
<% if (
|
||||
!isSubscriptionEligible
|
||||
&& is_learner_eligible_for_one_click_purchase
|
||||
&& (typeof is_mobile_only === 'undefined' || is_mobile_only === false)
|
||||
|
||||
Reference in New Issue
Block a user