From ceadad141ec95cafc51dd2897f36876423a3bd2b Mon Sep 17 00:00:00 2001 From: Andy Gout Date: Fri, 15 Mar 2024 13:24:38 +0000 Subject: [PATCH] Remove isFixedTermOffer --- components/payment-term.jsx | 28 +++++++---------------- components/payment-term.spec.js | 36 ------------------------------ components/payment-term.stories.js | 19 ---------------- 3 files changed, 8 insertions(+), 75 deletions(-) diff --git a/components/payment-term.jsx b/components/payment-term.jsx index b588dc5b..84f08ba1 100644 --- a/components/payment-term.jsx +++ b/components/payment-term.jsx @@ -9,8 +9,6 @@ export function PaymentTerm({ isPrintOrBundle = false, isEpaper = false, options = [], - isFixedTermOffer = false, - offerDisplayName, showLegal = true, largePrice = false, optionsInARow = false, @@ -133,15 +131,11 @@ export function PaymentTerm({ ), monthlyPrice: () => {}, - renewsText: (isFixedTermOffer) => { - const textToDisplay = isFixedTermOffer - ? 'This subscription is for 3 months, charged monthly. You can cancel at anytime' - : 'Renews monthly unless cancelled'; - - return ( -

{textToDisplay}

- ); - }, + renewsText: () => ( +

+ {'Renews monthly unless cancelled'} +

+ ), }, custom: { price: (price) => ( @@ -235,7 +229,7 @@ export function PaymentTerm({
{nameMap[option.name].price(option.price)} {nameMap[option.name].monthlyPrice(option.monthlyPrice)} - {nameMap[option.name].renewsText(isFixedTermOffer)} + {nameMap[option.name].renewsText()} {/* Remove this discount text temporarily in favour of monthly price */} {/*
Save up to 25% when you pay annually */}
@@ -287,13 +281,9 @@ export function PaymentTerm({ return labelOverride; } - const defaultTitle = + const title = option.name && nameMap[option.name] ? nameMap[option.name].title : ''; - const title = isFixedTermOffer - ? `${offerDisplayName} - ${defaultTitle}` - : defaultTitle; - let termDisplayName = ''; if (showTrialCopyInTitle) { const termName = option.displayName @@ -363,7 +353,7 @@ export function PaymentTerm({ {showLegal && (
- {isTermedSubscriptionTermType || isFixedTermOffer ? ( + {isTermedSubscriptionTermType ? (

Find out more about our cancellation policy in our{' '} { }); }); - describe('given isFixedTermOffer prop is set to true', () => { - const options = [ - { - name: 'monthly', - price: '$5.00', - value: 'monthly', - monthlyPrice: '$5.00', - }, - ]; - const wrapper = shallow( - - ); - - it('does not include renewal text', () => { - expect( - wrapper.find('.ncf__payment-term__renews-text').text() - ).not.toMatch(/Renews (annually|monthly|quarterly) unless cancelled/); - }); - - it('renders fixed term renewal text in English', () => { - expect(wrapper.find('.ncf__payment-term__renews-text').text()).toMatch( - /This subscription is for 3 months, charged monthly. You can cancel at anytime/ - ); - }); - - it('renders offer name on payment term title', () => { - expect(wrapper.find('.ncf__payment-term__title').text()).toMatch( - 'Mix & Match - Monthly' - ); - }); - }); - describe('given isTermedSubscriptionTermType is true', () => { describe('options include duration expressed in weeks', () => { const options = [ diff --git a/components/payment-term.stories.js b/components/payment-term.stories.js index b97f3bcb..cba31e09 100644 --- a/components/payment-term.stories.js +++ b/components/payment-term.stories.js @@ -90,25 +90,6 @@ Basic.args = { ], }; -export const FixedTermOffer = (args) => ( -

-
- -
-
-); -FixedTermOffer.args = { - options: [ - { - name: 'monthly', - price: '$5.00', - value: 5.0, - }, - ], - isFixedTermOffer: true, - offerDisplayName: 'Mix & Match', -}; - export const TermedSubscriptionTermType = (args) => (