@financial-times/n-conversion-forms 37.2.0 → 37.2.2
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.
- package/.toolkitstate/ci.json +2 -2
- package/components/__snapshots__/delivery-start-date.spec.js.snap +51 -9
- package/components/delivery-option.jsx +6 -6
- package/components/delivery-start-date.jsx +8 -7
- package/dist/delivery-option.jsx +8 -3
- package/dist/delivery-start-date.jsx +3 -2
- package/package.json +1 -1
- package/utils/delivery-option-messages.js +14 -12
- package/utils/delivery-option-messages.spec.js +66 -51
package/.toolkitstate/ci.json
CHANGED
|
@@ -13,7 +13,7 @@ exports[`DeliveryStartDate renders with a custom date 1`] = `
|
|
|
13
13
|
Start date
|
|
14
14
|
</span>
|
|
15
15
|
<span class="o-forms-title__prompt">
|
|
16
|
-
|
|
16
|
+
Earliest available delivery date: 5th November 2019
|
|
17
17
|
</span>
|
|
18
18
|
</span>
|
|
19
19
|
<span class="o-forms-input o-forms-input--text">
|
|
@@ -29,6 +29,12 @@ exports[`DeliveryStartDate renders with a custom date 1`] = `
|
|
|
29
29
|
Please select a valid start date
|
|
30
30
|
</span>
|
|
31
31
|
</span>
|
|
32
|
+
<p>
|
|
33
|
+
The first print edition you will receive is:
|
|
34
|
+
<strong class="js-start-date-text">
|
|
35
|
+
5th November 2019
|
|
36
|
+
</strong>
|
|
37
|
+
</p>
|
|
32
38
|
</label>
|
|
33
39
|
`;
|
|
34
40
|
|
|
@@ -45,7 +51,7 @@ exports[`DeliveryStartDate renders with a custom input max value 1`] = `
|
|
|
45
51
|
Start date
|
|
46
52
|
</span>
|
|
47
53
|
<span class="o-forms-title__prompt">
|
|
48
|
-
|
|
54
|
+
Earliest available delivery date: 2
|
|
49
55
|
</span>
|
|
50
56
|
</span>
|
|
51
57
|
<span class="o-forms-input o-forms-input--text">
|
|
@@ -61,6 +67,12 @@ exports[`DeliveryStartDate renders with a custom input max value 1`] = `
|
|
|
61
67
|
Please select a valid start date
|
|
62
68
|
</span>
|
|
63
69
|
</span>
|
|
70
|
+
<p>
|
|
71
|
+
The first print edition you will receive is:
|
|
72
|
+
<strong class="js-start-date-text">
|
|
73
|
+
2
|
|
74
|
+
</strong>
|
|
75
|
+
</p>
|
|
64
76
|
</label>
|
|
65
77
|
`;
|
|
66
78
|
|
|
@@ -77,7 +89,7 @@ exports[`DeliveryStartDate renders with a custom input min value 1`] = `
|
|
|
77
89
|
Start date
|
|
78
90
|
</span>
|
|
79
91
|
<span class="o-forms-title__prompt">
|
|
80
|
-
|
|
92
|
+
Earliest available delivery date:
|
|
81
93
|
</span>
|
|
82
94
|
</span>
|
|
83
95
|
<span class="o-forms-input o-forms-input--text">
|
|
@@ -94,6 +106,11 @@ exports[`DeliveryStartDate renders with a custom input min value 1`] = `
|
|
|
94
106
|
Please select a valid start date
|
|
95
107
|
</span>
|
|
96
108
|
</span>
|
|
109
|
+
<p>
|
|
110
|
+
The first print edition you will receive is:
|
|
111
|
+
<strong class="js-start-date-text">
|
|
112
|
+
</strong>
|
|
113
|
+
</p>
|
|
97
114
|
</label>
|
|
98
115
|
`;
|
|
99
116
|
|
|
@@ -110,7 +127,7 @@ exports[`DeliveryStartDate renders with a custom input value 1`] = `
|
|
|
110
127
|
Start date
|
|
111
128
|
</span>
|
|
112
129
|
<span class="o-forms-title__prompt">
|
|
113
|
-
|
|
130
|
+
Earliest available delivery date:
|
|
114
131
|
</span>
|
|
115
132
|
</span>
|
|
116
133
|
<span class="o-forms-input o-forms-input--text">
|
|
@@ -126,6 +143,11 @@ exports[`DeliveryStartDate renders with a custom input value 1`] = `
|
|
|
126
143
|
Please select a valid start date
|
|
127
144
|
</span>
|
|
128
145
|
</span>
|
|
146
|
+
<p>
|
|
147
|
+
The first print edition you will receive is:
|
|
148
|
+
<strong class="js-start-date-text">
|
|
149
|
+
</strong>
|
|
150
|
+
</p>
|
|
129
151
|
</label>
|
|
130
152
|
`;
|
|
131
153
|
|
|
@@ -142,7 +164,7 @@ exports[`DeliveryStartDate renders with a disabled input 1`] = `
|
|
|
142
164
|
Start date
|
|
143
165
|
</span>
|
|
144
166
|
<span class="o-forms-title__prompt">
|
|
145
|
-
|
|
167
|
+
Earliest available delivery date:
|
|
146
168
|
</span>
|
|
147
169
|
</span>
|
|
148
170
|
<span class="o-forms-input o-forms-input--text">
|
|
@@ -159,6 +181,11 @@ exports[`DeliveryStartDate renders with a disabled input 1`] = `
|
|
|
159
181
|
Please select a valid start date
|
|
160
182
|
</span>
|
|
161
183
|
</span>
|
|
184
|
+
<p>
|
|
185
|
+
The first print edition you will receive is:
|
|
186
|
+
<strong class="js-start-date-text">
|
|
187
|
+
</strong>
|
|
188
|
+
</p>
|
|
162
189
|
</label>
|
|
163
190
|
`;
|
|
164
191
|
|
|
@@ -175,7 +202,7 @@ exports[`DeliveryStartDate renders with an error 1`] = `
|
|
|
175
202
|
Start date
|
|
176
203
|
</span>
|
|
177
204
|
<span class="o-forms-title__prompt">
|
|
178
|
-
|
|
205
|
+
Earliest available delivery date:
|
|
179
206
|
</span>
|
|
180
207
|
</span>
|
|
181
208
|
<span class="o-forms-input o-forms-input--text o-forms-input--invalid">
|
|
@@ -191,6 +218,11 @@ exports[`DeliveryStartDate renders with an error 1`] = `
|
|
|
191
218
|
Please select a valid start date
|
|
192
219
|
</span>
|
|
193
220
|
</span>
|
|
221
|
+
<p>
|
|
222
|
+
The first print edition you will receive is:
|
|
223
|
+
<strong class="js-start-date-text">
|
|
224
|
+
</strong>
|
|
225
|
+
</p>
|
|
194
226
|
</label>
|
|
195
227
|
`;
|
|
196
228
|
|
|
@@ -207,7 +239,7 @@ exports[`DeliveryStartDate renders with appropriate start message when isAddress
|
|
|
207
239
|
Start date
|
|
208
240
|
</span>
|
|
209
241
|
<span class="o-forms-title__prompt">
|
|
210
|
-
|
|
242
|
+
Earliest available delivery date:
|
|
211
243
|
</span>
|
|
212
244
|
</span>
|
|
213
245
|
<span class="o-forms-input o-forms-input--text">
|
|
@@ -244,7 +276,7 @@ exports[`DeliveryStartDate renders with country different than default 1`] = `
|
|
|
244
276
|
Start date
|
|
245
277
|
</span>
|
|
246
278
|
<span class="o-forms-title__prompt">
|
|
247
|
-
|
|
279
|
+
Earliest available delivery date:
|
|
248
280
|
</span>
|
|
249
281
|
</span>
|
|
250
282
|
<span class="o-forms-input o-forms-input--text">
|
|
@@ -260,6 +292,11 @@ exports[`DeliveryStartDate renders with country different than default 1`] = `
|
|
|
260
292
|
Please select a valid start date
|
|
261
293
|
</span>
|
|
262
294
|
</span>
|
|
295
|
+
<p>
|
|
296
|
+
The first print edition you will receive is:
|
|
297
|
+
<strong class="js-start-date-text">
|
|
298
|
+
</strong>
|
|
299
|
+
</p>
|
|
263
300
|
</label>
|
|
264
301
|
`;
|
|
265
302
|
|
|
@@ -276,7 +313,7 @@ exports[`DeliveryStartDate renders with default props 1`] = `
|
|
|
276
313
|
Start date
|
|
277
314
|
</span>
|
|
278
315
|
<span class="o-forms-title__prompt">
|
|
279
|
-
|
|
316
|
+
Earliest available delivery date:
|
|
280
317
|
</span>
|
|
281
318
|
</span>
|
|
282
319
|
<span class="o-forms-input o-forms-input--text">
|
|
@@ -292,5 +329,10 @@ exports[`DeliveryStartDate renders with default props 1`] = `
|
|
|
292
329
|
Please select a valid start date
|
|
293
330
|
</span>
|
|
294
331
|
</span>
|
|
332
|
+
<p>
|
|
333
|
+
The first print edition you will receive is:
|
|
334
|
+
<strong class="js-start-date-text">
|
|
335
|
+
</strong>
|
|
336
|
+
</p>
|
|
295
337
|
</label>
|
|
296
338
|
`;
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
|
|
10
10
|
export function DeliveryOption({
|
|
11
11
|
fieldId = 'deliveryOptionField',
|
|
12
|
-
country,
|
|
12
|
+
country: countryCode,
|
|
13
13
|
productCode = undefined,
|
|
14
14
|
options = [],
|
|
15
15
|
isSingle = false,
|
|
@@ -20,7 +20,7 @@ export function DeliveryOption({
|
|
|
20
20
|
{ 'ncf__delivery-option--single': isSingle },
|
|
21
21
|
]);
|
|
22
22
|
|
|
23
|
-
const
|
|
23
|
+
const shippingZone = identifyFTShippingZone(countryCode);
|
|
24
24
|
|
|
25
25
|
return (
|
|
26
26
|
<div
|
|
@@ -32,12 +32,12 @@ export function DeliveryOption({
|
|
|
32
32
|
<span className="o-forms-input o-forms-input--radio-round">
|
|
33
33
|
{options.map((option) => {
|
|
34
34
|
const { value, isValidDeliveryOption, isSelected } = option;
|
|
35
|
-
const deliveryOptionValue = getDeliveryOption(
|
|
35
|
+
const deliveryOptionValue = getDeliveryOption({
|
|
36
36
|
productCode,
|
|
37
37
|
option,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
);
|
|
38
|
+
shippingZone,
|
|
39
|
+
countryCode,
|
|
40
|
+
});
|
|
41
41
|
|
|
42
42
|
if (!isValidDeliveryOption || !deliveryOptionValue) {
|
|
43
43
|
return null;
|
|
@@ -30,6 +30,10 @@ export function DeliveryStartDate({
|
|
|
30
30
|
defaultValue: value,
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
+
const startMessage = isAddressUpdate
|
|
34
|
+
? 'We’ll start delivering to this address from:'
|
|
35
|
+
: 'The first print edition you will receive is:';
|
|
36
|
+
|
|
33
37
|
return (
|
|
34
38
|
<label
|
|
35
39
|
id="deliveryStartDateField"
|
|
@@ -42,7 +46,7 @@ export function DeliveryStartDate({
|
|
|
42
46
|
Start date
|
|
43
47
|
</span>
|
|
44
48
|
<span className="o-forms-title__prompt">
|
|
45
|
-
|
|
49
|
+
Earliest available delivery date: {date}
|
|
46
50
|
</span>
|
|
47
51
|
</span>
|
|
48
52
|
|
|
@@ -53,12 +57,9 @@ export function DeliveryStartDate({
|
|
|
53
57
|
</span>
|
|
54
58
|
</span>
|
|
55
59
|
|
|
56
|
-
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
<strong className="js-start-date-text">{date}</strong>
|
|
60
|
-
</p>
|
|
61
|
-
)}
|
|
60
|
+
<p>
|
|
61
|
+
{startMessage} <strong className="js-start-date-text">{date}</strong>
|
|
62
|
+
</p>
|
|
62
63
|
</label>
|
|
63
64
|
);
|
|
64
65
|
}
|
package/dist/delivery-option.jsx
CHANGED
|
@@ -13,7 +13,7 @@ var _supportedCountries = require("../helpers/supportedCountries");
|
|
|
13
13
|
function DeliveryOption(_ref) {
|
|
14
14
|
var _ref$fieldId = _ref.fieldId,
|
|
15
15
|
fieldId = _ref$fieldId === void 0 ? 'deliveryOptionField' : _ref$fieldId,
|
|
16
|
-
|
|
16
|
+
countryCode = _ref.country,
|
|
17
17
|
_ref$productCode = _ref.productCode,
|
|
18
18
|
productCode = _ref$productCode === void 0 ? undefined : _ref$productCode,
|
|
19
19
|
_ref$options = _ref.options,
|
|
@@ -23,7 +23,7 @@ function DeliveryOption(_ref) {
|
|
|
23
23
|
var divClassName = (0, _classnames["default"])(['o-forms-field', 'ncf__delivery-option', {
|
|
24
24
|
'ncf__delivery-option--single': isSingle
|
|
25
25
|
}]);
|
|
26
|
-
var
|
|
26
|
+
var shippingZone = (0, _supportedCountries.identifyFTShippingZone)(countryCode);
|
|
27
27
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
28
28
|
id: fieldId,
|
|
29
29
|
className: divClassName,
|
|
@@ -35,7 +35,12 @@ function DeliveryOption(_ref) {
|
|
|
35
35
|
var value = option.value,
|
|
36
36
|
isValidDeliveryOption = option.isValidDeliveryOption,
|
|
37
37
|
isSelected = option.isSelected;
|
|
38
|
-
var deliveryOptionValue = (0, _deliveryOptionMessages.getDeliveryOption)(
|
|
38
|
+
var deliveryOptionValue = (0, _deliveryOptionMessages.getDeliveryOption)({
|
|
39
|
+
productCode: productCode,
|
|
40
|
+
option: option,
|
|
41
|
+
shippingZone: shippingZone,
|
|
42
|
+
countryCode: countryCode
|
|
43
|
+
});
|
|
39
44
|
if (!isValidDeliveryOption || !deliveryOptionValue) {
|
|
40
45
|
return null;
|
|
41
46
|
}
|
|
@@ -44,6 +44,7 @@ function DeliveryStartDate(_ref) {
|
|
|
44
44
|
disabled: isDisabled,
|
|
45
45
|
defaultValue: value
|
|
46
46
|
});
|
|
47
|
+
var startMessage = isAddressUpdate ? 'We’ll start delivering to this address from:' : 'The first print edition you will receive is:';
|
|
47
48
|
return /*#__PURE__*/_react["default"].createElement("label", {
|
|
48
49
|
id: "deliveryStartDateField",
|
|
49
50
|
className: "o-forms-field ncf__validation-error",
|
|
@@ -56,11 +57,11 @@ function DeliveryStartDate(_ref) {
|
|
|
56
57
|
id: "start-date-picker-title-span"
|
|
57
58
|
}, "Start date"), /*#__PURE__*/_react["default"].createElement("span", {
|
|
58
59
|
className: "o-forms-title__prompt"
|
|
59
|
-
}, "
|
|
60
|
+
}, "Earliest available delivery date: ", date)), /*#__PURE__*/_react["default"].createElement("span", {
|
|
60
61
|
className: inputWrapperClassNames
|
|
61
62
|
}, /*#__PURE__*/_react["default"].createElement("input", inputProps), /*#__PURE__*/_react["default"].createElement("span", {
|
|
62
63
|
className: "o-forms-input__error"
|
|
63
|
-
}, "Please select a valid start date")),
|
|
64
|
+
}, "Please select a valid start date")), /*#__PURE__*/_react["default"].createElement("p", null, startMessage, " ", /*#__PURE__*/_react["default"].createElement("strong", {
|
|
64
65
|
className: "js-start-date-text"
|
|
65
66
|
}, date)));
|
|
66
67
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@financial-times/n-conversion-forms",
|
|
3
|
-
"version": "37.2.
|
|
3
|
+
"version": "37.2.2",
|
|
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": {
|
|
@@ -257,38 +257,38 @@ function includesDeliveryFrequency(productCode = '', item) {
|
|
|
257
257
|
});
|
|
258
258
|
}
|
|
259
259
|
|
|
260
|
-
function mailStrategy(productCode,
|
|
260
|
+
function mailStrategy(productCode, shippingZone, item) {
|
|
261
261
|
return (
|
|
262
262
|
includesDeliveryFrequency(productCode, item) &&
|
|
263
263
|
item.distributorType === MAIL &&
|
|
264
|
-
item.country.includes(
|
|
264
|
+
item.country.includes(shippingZone)
|
|
265
265
|
);
|
|
266
266
|
}
|
|
267
267
|
|
|
268
|
-
function handDeliveryStrategy(productCode, option,
|
|
268
|
+
function handDeliveryStrategy(productCode, option, shippingZone, item) {
|
|
269
269
|
return (
|
|
270
270
|
includesDeliveryFrequency(productCode, item) &&
|
|
271
271
|
item.distributorType === HAND_DELIVERY &&
|
|
272
272
|
item.deliveryOnPublicationDate === option.deliveryOnPublicationDate &&
|
|
273
273
|
item.flightMarket === option.flightMarket &&
|
|
274
|
-
item.country.includes(
|
|
274
|
+
item.country.includes(shippingZone)
|
|
275
275
|
);
|
|
276
276
|
}
|
|
277
277
|
|
|
278
278
|
/**
|
|
279
|
-
* Method to find a specific delivery option based on the delivery frequency,
|
|
279
|
+
* Method to find a specific delivery option based on the delivery frequency, shippingZone and option values.
|
|
280
280
|
* There are two different strategies, one for options with mailDelivery = true and other by the opposite.
|
|
281
281
|
* Both cases are represented by system option code 'HD', but differ on the mailDelivery property value.
|
|
282
282
|
* If no message matchs, then undefined is returned.
|
|
283
283
|
*/
|
|
284
|
-
function findCustomDeliveryOption(productCode, option,
|
|
284
|
+
function findCustomDeliveryOption(productCode, option, shippingZone) {
|
|
285
285
|
let deliveryOption;
|
|
286
286
|
|
|
287
287
|
if (option.value === HAND_DELIVERY) {
|
|
288
288
|
const filteredMessages = deliveryOptionMessages.filter((item) => {
|
|
289
289
|
return option.mailDelivery
|
|
290
|
-
? mailStrategy(productCode,
|
|
291
|
-
: handDeliveryStrategy(productCode, option,
|
|
290
|
+
? mailStrategy(productCode, shippingZone, item)
|
|
291
|
+
: handDeliveryStrategy(productCode, option, shippingZone, item);
|
|
292
292
|
});
|
|
293
293
|
|
|
294
294
|
if (filteredMessages.length) {
|
|
@@ -300,13 +300,15 @@ function findCustomDeliveryOption(productCode, option, FTShippingZone) {
|
|
|
300
300
|
return deliveryOption;
|
|
301
301
|
}
|
|
302
302
|
|
|
303
|
-
function getDeliveryOption(productCode, option,
|
|
303
|
+
function getDeliveryOption({ productCode, option, shippingZone, countryCode }) {
|
|
304
304
|
// Custom delivery messages are displayed for certain countries
|
|
305
|
-
if (
|
|
306
|
-
|
|
305
|
+
if (
|
|
306
|
+
Object.keys(countryCodeToCustomDeliveryOptionsMap).includes(countryCode)
|
|
307
|
+
) {
|
|
308
|
+
return countryCodeToCustomDeliveryOptionsMap[countryCode][option.value];
|
|
307
309
|
}
|
|
308
310
|
|
|
309
|
-
return findCustomDeliveryOption(productCode, option,
|
|
311
|
+
return findCustomDeliveryOption(productCode, option, shippingZone);
|
|
310
312
|
}
|
|
311
313
|
|
|
312
314
|
module.exports = {
|
|
@@ -14,14 +14,24 @@ describe('Find Custom Delivery Option', () => {
|
|
|
14
14
|
|
|
15
15
|
it('returns undefined when other country than custom messages', () => {
|
|
16
16
|
expect(
|
|
17
|
-
getDeliveryOption(
|
|
17
|
+
getDeliveryOption({
|
|
18
|
+
productCode: sixDaysProductCode,
|
|
19
|
+
option: stubOption,
|
|
20
|
+
shippingZone: 'AAA',
|
|
21
|
+
countryCode: 'AAA',
|
|
22
|
+
})
|
|
18
23
|
).toBeUndefined();
|
|
19
24
|
});
|
|
20
25
|
|
|
21
26
|
it('returns undefined when invalid distributor type code', () => {
|
|
22
27
|
const option = { ...stubOption, value: 'ZZ' };
|
|
23
28
|
expect(
|
|
24
|
-
getDeliveryOption(
|
|
29
|
+
getDeliveryOption({
|
|
30
|
+
productCode: sixDaysProductCode,
|
|
31
|
+
option: option,
|
|
32
|
+
shippingZone: 'USA',
|
|
33
|
+
countryCode: 'USA',
|
|
34
|
+
})
|
|
25
35
|
).toBeUndefined();
|
|
26
36
|
});
|
|
27
37
|
|
|
@@ -29,7 +39,12 @@ describe('Find Custom Delivery Option', () => {
|
|
|
29
39
|
stubOption.deliveryOnPublicationDate = undefined;
|
|
30
40
|
stubOption.flightMarket = undefined;
|
|
31
41
|
expect(
|
|
32
|
-
getDeliveryOption(
|
|
42
|
+
getDeliveryOption({
|
|
43
|
+
productCode: sixDaysProductCode,
|
|
44
|
+
option: stubOption,
|
|
45
|
+
shippingZone: 'AAA',
|
|
46
|
+
countryCode: 'AAA',
|
|
47
|
+
})
|
|
33
48
|
).toBeUndefined();
|
|
34
49
|
});
|
|
35
50
|
});
|
|
@@ -48,12 +63,12 @@ describe('Find Custom Delivery Option', () => {
|
|
|
48
63
|
'Enjoy delivery of the newspaper daily to your home or office address.',
|
|
49
64
|
};
|
|
50
65
|
|
|
51
|
-
const deliveryOption = getDeliveryOption(
|
|
52
|
-
sixDaysProductCode,
|
|
53
|
-
stubOption,
|
|
54
|
-
'USA',
|
|
55
|
-
'USA'
|
|
56
|
-
);
|
|
66
|
+
const deliveryOption = getDeliveryOption({
|
|
67
|
+
productCode: sixDaysProductCode,
|
|
68
|
+
option: stubOption,
|
|
69
|
+
shippingZone: 'USA',
|
|
70
|
+
countryCode: 'USA',
|
|
71
|
+
});
|
|
57
72
|
|
|
58
73
|
expect(deliveryOption).toEqual(expected);
|
|
59
74
|
});
|
|
@@ -67,12 +82,12 @@ describe('Find Custom Delivery Option', () => {
|
|
|
67
82
|
'Enjoy delivery of the newspaper daily to your home or office address. \nPlease note: Your FT Weekend will be delivered on Sunday.',
|
|
68
83
|
};
|
|
69
84
|
|
|
70
|
-
const deliveryOption = getDeliveryOption(
|
|
71
|
-
weekendProductCode,
|
|
72
|
-
stubOption,
|
|
73
|
-
'USA',
|
|
74
|
-
'USA'
|
|
75
|
-
);
|
|
85
|
+
const deliveryOption = getDeliveryOption({
|
|
86
|
+
productCode: weekendProductCode,
|
|
87
|
+
option: stubOption,
|
|
88
|
+
shippingZone: 'USA',
|
|
89
|
+
countryCode: 'USA',
|
|
90
|
+
});
|
|
76
91
|
|
|
77
92
|
expect(deliveryOption).toEqual(expected);
|
|
78
93
|
});
|
|
@@ -91,12 +106,12 @@ describe('Find Custom Delivery Option', () => {
|
|
|
91
106
|
"We can only deliver the newspaper to your location by postal mail which means your delivery will arrive up to 5 business days after the date of publication and will not include the HTSI Magazine. We also fly the newspaper to your location which means delivery is subject to flight delays/cancellations outside the FT's control. If you prefer to read the printed content on the day of publication, please proceed to subscribe to the FT ePaper - a digital replica of the print edition.",
|
|
92
107
|
};
|
|
93
108
|
|
|
94
|
-
const deliveryOption = getDeliveryOption(
|
|
95
|
-
sixDaysProductCode,
|
|
96
|
-
stubOption,
|
|
97
|
-
'USA',
|
|
98
|
-
'USA'
|
|
99
|
-
);
|
|
109
|
+
const deliveryOption = getDeliveryOption({
|
|
110
|
+
productCode: sixDaysProductCode,
|
|
111
|
+
option: stubOption,
|
|
112
|
+
shippingZone: 'USA',
|
|
113
|
+
countryCode: 'USA',
|
|
114
|
+
});
|
|
100
115
|
|
|
101
116
|
expect(deliveryOption).toEqual(expected);
|
|
102
117
|
});
|
|
@@ -109,12 +124,12 @@ describe('Find Custom Delivery Option', () => {
|
|
|
109
124
|
"We can only deliver the FT Weekend newspaper to your location by postal mail which means your delivery will arrive up to 5 business days after the date of publication and will not include the HTSI Magazine. We also fly the newspaper to your location which means delivery is subject to flight delays/cancellations outside the FT's control. If you prefer to read the printed content on the day of publication, please proceed to subscribe to the FT ePaper - a digital replica of the print edition.",
|
|
110
125
|
};
|
|
111
126
|
|
|
112
|
-
const deliveryOption = getDeliveryOption(
|
|
113
|
-
weekendProductCode,
|
|
114
|
-
stubOption,
|
|
115
|
-
'CAN',
|
|
116
|
-
'CAN'
|
|
117
|
-
);
|
|
127
|
+
const deliveryOption = getDeliveryOption({
|
|
128
|
+
productCode: weekendProductCode,
|
|
129
|
+
option: stubOption,
|
|
130
|
+
shippingZone: 'CAN',
|
|
131
|
+
countryCode: 'CAN',
|
|
132
|
+
});
|
|
118
133
|
|
|
119
134
|
expect(deliveryOption).toEqual(expected);
|
|
120
135
|
});
|
|
@@ -128,12 +143,12 @@ describe('Find Custom Delivery Option', () => {
|
|
|
128
143
|
'Delivered via email and card, redeemable at retailers nationwide.',
|
|
129
144
|
};
|
|
130
145
|
|
|
131
|
-
const deliveryOption = getDeliveryOption(
|
|
132
|
-
sixDaysProductCode,
|
|
133
|
-
{ value: 'EV' },
|
|
134
|
-
'GBR',
|
|
135
|
-
'GBR'
|
|
136
|
-
);
|
|
146
|
+
const deliveryOption = getDeliveryOption({
|
|
147
|
+
productCode: sixDaysProductCode,
|
|
148
|
+
option: { value: 'EV' },
|
|
149
|
+
shippingZone: 'GBR',
|
|
150
|
+
countryCode: 'GBR',
|
|
151
|
+
});
|
|
137
152
|
|
|
138
153
|
expect(deliveryOption).toEqual(expected);
|
|
139
154
|
});
|
|
@@ -146,12 +161,12 @@ describe('Find Custom Delivery Option', () => {
|
|
|
146
161
|
'Enjoy delivery of the newspaper to your home or office address.',
|
|
147
162
|
};
|
|
148
163
|
|
|
149
|
-
const deliveryOption = getDeliveryOption(
|
|
150
|
-
sixDaysProductCode,
|
|
151
|
-
stubOption,
|
|
152
|
-
'APAC',
|
|
153
|
-
'JPN'
|
|
154
|
-
);
|
|
164
|
+
const deliveryOption = getDeliveryOption({
|
|
165
|
+
productCode: sixDaysProductCode,
|
|
166
|
+
option: stubOption,
|
|
167
|
+
shippingZone: 'APAC',
|
|
168
|
+
countryCode: 'JPN',
|
|
169
|
+
});
|
|
155
170
|
|
|
156
171
|
expect(deliveryOption).toEqual(expected);
|
|
157
172
|
});
|
|
@@ -168,12 +183,12 @@ describe('Find Custom Delivery Option', () => {
|
|
|
168
183
|
'Enjoy the delivery of the newspaper to your home or office address. Please note we fly the newspaper to your location which means delivery is subject to flight delays/cancellations outside of the FT’s control. In those circumstances, your newspaper will be delivered the next delivery day. Please also be aware that your FT weekend will be delivered on Sunday.',
|
|
169
184
|
};
|
|
170
185
|
|
|
171
|
-
const deliveryOption = getDeliveryOption(
|
|
172
|
-
'N6D',
|
|
173
|
-
stubOption,
|
|
174
|
-
'CEMEA_V1',
|
|
175
|
-
'BGR'
|
|
176
|
-
);
|
|
186
|
+
const deliveryOption = getDeliveryOption({
|
|
187
|
+
productCode: 'N6D',
|
|
188
|
+
option: stubOption,
|
|
189
|
+
shippingZone: 'CEMEA_V1',
|
|
190
|
+
countryCode: 'BGR',
|
|
191
|
+
});
|
|
177
192
|
|
|
178
193
|
expect(deliveryOption).toEqual(expected);
|
|
179
194
|
});
|
|
@@ -188,12 +203,12 @@ describe('Find Custom Delivery Option', () => {
|
|
|
188
203
|
'Enjoy delivery of the newspaper to your home or office address. Note this is a postal delivery - expect delivery after the day of publication. If you would prefer to read the newspaper on the day of publication, purchase an FT ePaper subscription, our digital replica of each daily edition.',
|
|
189
204
|
};
|
|
190
205
|
|
|
191
|
-
const deliveryOption = getDeliveryOption(
|
|
192
|
-
'N6D',
|
|
193
|
-
stubOption,
|
|
194
|
-
'APAC',
|
|
195
|
-
'HKG'
|
|
196
|
-
);
|
|
206
|
+
const deliveryOption = getDeliveryOption({
|
|
207
|
+
productCode: 'N6D',
|
|
208
|
+
option: stubOption,
|
|
209
|
+
shippingZone: 'APAC',
|
|
210
|
+
countryCode: 'HKG',
|
|
211
|
+
});
|
|
197
212
|
|
|
198
213
|
expect(deliveryOption).toEqual(expected);
|
|
199
214
|
});
|