@transferwise/comparison-components 22.1.1 → 22.1.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/CHANGELOG.md +3 -0
- package/dist/es/{ComparisonTableHeroContainer-d379db01.js → ComparisonTableHeroContainer-5e3515b2.js} +2 -2
- package/dist/es/{ComparisonTableHeroContainer-d379db01.js.map → ComparisonTableHeroContainer-5e3515b2.js.map} +1 -1
- package/dist/es/{ErrorTemplate-6f86868b.js → ErrorTemplate-6348c8ca.js} +2 -2
- package/dist/es/{ErrorTemplate-6f86868b.js.map → ErrorTemplate-6348c8ca.js.map} +1 -1
- package/dist/es/{ProviderComparisonTable-e908e4d2.js → ProviderComparisonTable-6a08c5fd.js} +2 -2
- package/dist/es/{ProviderComparisonTable-e908e4d2.js.map → ProviderComparisonTable-6a08c5fd.js.map} +1 -1
- package/dist/es/{ReceiveAmount-23c14672.js → ReceiveAmount-94730ff0.js} +2 -2
- package/dist/es/{ReceiveAmount-23c14672.js.map → ReceiveAmount-94730ff0.js.map} +1 -1
- package/dist/es/{TravelMoney-fd349081.js → TravelMoney-10abbf0b.js} +2 -2
- package/dist/es/{TravelMoney-fd349081.js.map → TravelMoney-10abbf0b.js.map} +1 -1
- package/dist/es/comparison/index.js +1 -1
- package/dist/es/comparison-table/index.js +1 -1
- package/dist/es/comparison-table-hero/index.js +1 -1
- package/dist/es/{index-e8c2c2df.js → index-f9c461f2.js} +2 -2
- package/dist/es/{index-e8c2c2df.js.map → index-f9c461f2.js.map} +1 -1
- package/dist/es/index.js +1 -1
- package/dist/es/provider-comparison-table/index.js +1 -1
- package/dist/es/provider-comparison-widget/index.js +1 -1
- package/dist/es/provider-comparison-widget/index.js.map +1 -1
- package/dist/es/travel-money/index.js +1 -1
- package/dist/umd/comparison-components.css +1 -1
- package/dist/umd/comparison-components.js +7 -7
- package/dist/umd/comparison-components.js.map +1 -1
- package/dist/umd/provider-comparison-widget/provider-comparison-widget.js +6 -6
- package/dist/umd/provider-comparison-widget/provider-comparison-widget.js.map +1 -1
- package/dist/umd/travel-money/travel-money.js +6 -6
- package/dist/umd/travel-money/travel-money.js.map +1 -1
- package/package.json +1 -1
- package/src/provider-comparison-widget/__test__/AmountInput.spec.jsx +7 -4
- package/src/provider-comparison-widget/components/AmountInput.jsx +2 -1
- package/src/travel-money/components/AmountInput.jsx +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@transferwise/comparison-components",
|
|
3
|
-
"version": "22.1.
|
|
3
|
+
"version": "22.1.2",
|
|
4
4
|
"description": "Display a comparison table of providers given a route and amount.",
|
|
5
5
|
"homepage": "https://wise.com/gb/compare/",
|
|
6
6
|
"main": "dist/umd/comparison-components.js",
|
|
@@ -8,9 +8,11 @@ import translations from '../assets/translations/translations.json';
|
|
|
8
8
|
import AmountInput from '../components/AmountInput';
|
|
9
9
|
|
|
10
10
|
jest.mock('@transferwise/formatting', () => ({
|
|
11
|
-
parseAmount: jest.fn(),
|
|
12
11
|
formatAmount: jest.fn(),
|
|
13
12
|
}));
|
|
13
|
+
jest.mock('@transferwise/components', () => ({
|
|
14
|
+
parseAmount: jest.fn(),
|
|
15
|
+
}));
|
|
14
16
|
const mountRenderComponent = (renderProps) =>
|
|
15
17
|
mount(
|
|
16
18
|
<IntlProvider locale="en" messages={translations.en}>
|
|
@@ -22,6 +24,7 @@ const mountRenderComponent = (renderProps) =>
|
|
|
22
24
|
},
|
|
23
25
|
);
|
|
24
26
|
|
|
27
|
+
const currencyParsing = require('@transferwise/components');
|
|
25
28
|
const currencyFormatting = require('@transferwise/formatting');
|
|
26
29
|
|
|
27
30
|
describe('AmountInput', () => {
|
|
@@ -72,7 +75,7 @@ describe('AmountInput', () => {
|
|
|
72
75
|
children: <AmountInput {...{ ...props, locale: 'en-US' }} />,
|
|
73
76
|
});
|
|
74
77
|
component.update();
|
|
75
|
-
jest.spyOn(
|
|
78
|
+
jest.spyOn(currencyParsing, 'parseAmount').mockImplementation(parseFloat);
|
|
76
79
|
enterAmount('123.45');
|
|
77
80
|
component.update();
|
|
78
81
|
expect(amountInput().prop('value')).toBe('123.45');
|
|
@@ -91,7 +94,7 @@ describe('AmountInput', () => {
|
|
|
91
94
|
});
|
|
92
95
|
|
|
93
96
|
component.update();
|
|
94
|
-
jest.spyOn(
|
|
97
|
+
jest.spyOn(currencyParsing, 'parseAmount').mockImplementation((amount, currency, locale) => {
|
|
95
98
|
expect(amount).toBe('500.1234');
|
|
96
99
|
expect(locale).toBe('es-ES');
|
|
97
100
|
expect(currency).toBe('eur');
|
|
@@ -114,7 +117,7 @@ describe('AmountInput', () => {
|
|
|
114
117
|
children: <AmountInput {...{ ...props, onAmountChange }} />,
|
|
115
118
|
});
|
|
116
119
|
component.update();
|
|
117
|
-
jest.spyOn(
|
|
120
|
+
jest.spyOn(currencyParsing, 'parseAmount').mockImplementation(() => NaN);
|
|
118
121
|
enterAmount('cannot parse this yo');
|
|
119
122
|
expect(onAmountChange).not.toHaveBeenCalled();
|
|
120
123
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { parseAmount } from '@transferwise/components';
|
|
2
|
+
import { formatAmount } from '@transferwise/formatting';
|
|
2
3
|
import PropTypes from 'prop-types';
|
|
3
4
|
import React, { useState, useEffect } from 'react';
|
|
4
5
|
import { FormattedMessage } from 'react-intl';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { parseAmount } from '@transferwise/components';
|
|
2
|
+
import { formatAmount } from '@transferwise/formatting';
|
|
2
3
|
import PropTypes from 'prop-types';
|
|
3
4
|
import React, { useState, useEffect } from 'react';
|
|
4
5
|
import { FormattedMessage } from 'react-intl';
|