@financial-times/n-conversion-forms 37.3.0 → 38.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "branch": "",
3
3
  "repo": "n-conversion-forms",
4
- "version": "a93af32641c5a2b8e2ed414046f5574052edf44a",
5
- "tag": "v37.3.0"
4
+ "version": "31e041f551d5077e705e60bc10e33df6fe32fd0f",
5
+ "tag": "v38.0.0"
6
6
  }
@@ -38,6 +38,24 @@ export function AcceptTermsSubscription({
38
38
  required: true,
39
39
  };
40
40
 
41
+ const autoRenewingTerms = !isSingleTerm && (
42
+ <li>
43
+ <span className="terms-auto-renew">
44
+ I give consent for my chosen payment method to be charged automatically
45
+ at the end of each subscription term until I cancel it by contacting{' '}
46
+ <a
47
+ className="ncf__link--external"
48
+ href="https://help.ft.com/help/contact-us/"
49
+ target={isEmbedded ? '_top' : '_blank'}
50
+ rel="noopener noreferrer"
51
+ >
52
+ customer care through chat, phone or email
53
+ </a>
54
+ .
55
+ </span>
56
+ </li>
57
+ );
58
+
41
59
  if (isTermedSubscriptionTermType) {
42
60
  return (
43
61
  <div {...divProps}>
@@ -88,24 +106,6 @@ export function AcceptTermsSubscription({
88
106
 
89
107
  const transitionTerms = isTransition && (
90
108
  <>
91
- {!isSingleTerm && (
92
- <li>
93
- <span className="terms-transition">
94
- I give consent for my chosen payment method to be charged
95
- automatically at the end of each subscription term until I cancel it
96
- by contacting{' '}
97
- <a
98
- className="ncf__link--external"
99
- href="https://help.ft.com/help/contact-us/"
100
- target="_blank"
101
- rel="noopener noreferrer"
102
- >
103
- customer care through chat, phone or email
104
- </a>
105
- .
106
- </span>
107
- </li>
108
- )}
109
109
  {transitionType === 'immediate' ? (
110
110
  <li>
111
111
  <span className="terms-transition terms-transition--immediate">
@@ -185,22 +185,6 @@ export function AcceptTermsSubscription({
185
185
 
186
186
  const nonPrintTerms = (
187
187
  <>
188
- <li>
189
- <span className="terms-signup">
190
- I give consent for my chosen payment method to be charged
191
- automatically at the end of each subscription term until I cancel it
192
- by contacting{' '}
193
- <a
194
- className="ncf__link--external"
195
- href="https://help.ft.com/help/contact-us/"
196
- target={isEmbedded ? '_top' : '_blank'}
197
- rel="noopener noreferrer"
198
- >
199
- customer care through chat, phone or email
200
- </a>
201
- .
202
- </span>
203
- </li>
204
188
  <li>
205
189
  <span className="terms-signup">
206
190
  By placing my order, my subscription will start immediately and I am
@@ -234,6 +218,7 @@ export function AcceptTermsSubscription({
234
218
  return (
235
219
  <div {...divProps}>
236
220
  <ul className="o-typography-list ncf__accept-terms-list">
221
+ {autoRenewingTerms}
237
222
  {transitionTerms}
238
223
  {signupTerms}
239
224
  {deferredBillingTerms}
@@ -47,6 +47,28 @@ describe('AcceptTermsSubscription', () => {
47
47
  expect(trialTerms.exists()).toBe(false);
48
48
  });
49
49
 
50
+ it('renders the auto renewing charges terms when isSingleTerm prop is false', () => {
51
+ const props = {
52
+ isSingleTerm: false,
53
+ };
54
+
55
+ const component = mount(<AcceptTermsSubscription {...props} />);
56
+
57
+ const printTerms = component.find('.terms-auto-renew');
58
+ expect(printTerms.exists()).toBe(true);
59
+ });
60
+
61
+ it('does not render the auto renewing charges terms when isSingleTerm prop is true', () => {
62
+ const props = {
63
+ isSingleTerm: true,
64
+ };
65
+
66
+ const component = mount(<AcceptTermsSubscription {...props} />);
67
+
68
+ const printTerms = component.find('.terms-auto-renew');
69
+ expect(printTerms.exists()).toBe(false);
70
+ });
71
+
50
72
  it('renders the print-specific terms when isPrintProduct prop is true', () => {
51
73
  const props = {
52
74
  isPrintProduct: true,
@@ -51,6 +51,14 @@ function AcceptTermsSubscription(_ref) {
51
51
  'aria-required': 'true',
52
52
  required: true
53
53
  };
54
+ var autoRenewingTerms = !isSingleTerm && /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("span", {
55
+ className: "terms-auto-renew"
56
+ }, "I give consent for my chosen payment method to be charged automatically at the end of each subscription term until I cancel it by contacting", ' ', /*#__PURE__*/_react["default"].createElement("a", {
57
+ className: "ncf__link--external",
58
+ href: "https://help.ft.com/help/contact-us/",
59
+ target: isEmbedded ? '_top' : '_blank',
60
+ rel: "noopener noreferrer"
61
+ }, "customer care through chat, phone or email"), "."));
54
62
  if (isTermedSubscriptionTermType) {
55
63
  return /*#__PURE__*/_react["default"].createElement("div", divProps, /*#__PURE__*/_react["default"].createElement("ul", {
56
64
  className: "o-typography-list ncf__accept-terms-list"
@@ -74,14 +82,7 @@ function AcceptTermsSubscription(_ref) {
74
82
  className: "o-forms-input__error"
75
83
  }, "Please accept our terms & conditions")));
76
84
  }
77
- var transitionTerms = isTransition && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, !isSingleTerm && /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("span", {
78
- className: "terms-transition"
79
- }, "I give consent for my chosen payment method to be charged automatically at the end of each subscription term until I cancel it by contacting", ' ', /*#__PURE__*/_react["default"].createElement("a", {
80
- className: "ncf__link--external",
81
- href: "https://help.ft.com/help/contact-us/",
82
- target: "_blank",
83
- rel: "noopener noreferrer"
84
- }, "customer care through chat, phone or email"), ".")), transitionType === 'immediate' ? /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("span", {
85
+ var transitionTerms = isTransition && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, transitionType === 'immediate' ? /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("span", {
85
86
  className: "terms-transition terms-transition--immediate"
86
87
  }, "By placing my order, my subscription will start immediately and I am aware and agree that I will therefore lose my statutory right to cancel my subscription within 14 days of acceptance of my order. Any notice of cancellation that I provide will only take effect at the end of my subscription period and previously paid amounts are non-refundable, except in the event that there is a fault in the provision of the services.")) : /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("span", {
87
88
  className: "terms-transition terms-transition--other"
@@ -109,13 +110,6 @@ function AcceptTermsSubscription(_ref) {
109
110
  }, "Terms & Conditions"), ".")));
110
111
  var nonPrintTerms = /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("span", {
111
112
  className: "terms-signup"
112
- }, "I give consent for my chosen payment method to be charged automatically at the end of each subscription term until I cancel it by contacting", ' ', /*#__PURE__*/_react["default"].createElement("a", {
113
- className: "ncf__link--external",
114
- href: "https://help.ft.com/help/contact-us/",
115
- target: isEmbedded ? '_top' : '_blank',
116
- rel: "noopener noreferrer"
117
- }, "customer care through chat, phone or email"), ".")), /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("span", {
118
- className: "terms-signup"
119
113
  }, "By placing my order, my subscription will start immediately and I am aware and agree that I will therefore lose my statutory right to cancel my subscription within 14 days of acceptance of my order. Any notice of cancellation that I provide will only take effect at the end of my subscription period and previously paid amounts are non-refundable, except in the event that there is a fault in the provision of the services.")), /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("span", {
120
114
  className: "terms-signup"
121
115
  }, "Find out more about our cancellation policy in our", ' ', /*#__PURE__*/_react["default"].createElement("a", {
@@ -127,7 +121,7 @@ function AcceptTermsSubscription(_ref) {
127
121
  var signupTerms = /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, isPrintProduct ? printTerms : nonPrintTerms);
128
122
  return /*#__PURE__*/_react["default"].createElement("div", divProps, /*#__PURE__*/_react["default"].createElement("ul", {
129
123
  className: "o-typography-list ncf__accept-terms-list"
130
- }, transitionTerms, signupTerms, deferredBillingTerms), /*#__PURE__*/_react["default"].createElement("label", {
124
+ }, autoRenewingTerms, transitionTerms, signupTerms, deferredBillingTerms), /*#__PURE__*/_react["default"].createElement("label", {
131
125
  className: labelClassName,
132
126
  htmlFor: "termsAcceptance"
133
127
  }, /*#__PURE__*/_react["default"].createElement("input", inputProps), /*#__PURE__*/_react["default"].createElement("span", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@financial-times/n-conversion-forms",
3
- "version": "37.3.0",
3
+ "version": "38.0.0",
4
4
  "description": "Containing jsx components and styles for forms included on Accounts and Acquisition apps (next-signup, next-profile, next-retention, etc).",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {