@oanda/labs-currency-cross-table 1.0.23 → 1.0.25
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 +204 -0
- package/dist/main/CurrencyCrossTableWidget/CurrencyCrossTableWidget.js +26 -27
- package/dist/main/CurrencyCrossTableWidget/CurrencyCrossTableWidget.js.map +1 -1
- package/dist/main/CurrencyCrossTableWidget/Main.js +10 -10
- package/dist/main/CurrencyCrossTableWidget/Main.js.map +1 -1
- package/dist/main/CurrencyCrossTableWidget/ValidationWrapper.js +6 -6
- package/dist/main/CurrencyCrossTableWidget/ValidationWrapper.js.map +1 -1
- package/dist/main/CurrencyCrossTableWidget/components/Cell.js +1 -1
- package/dist/main/CurrencyCrossTableWidget/components/Cell.js.map +1 -1
- package/dist/main/CurrencyCrossTableWidget/components/CellWithData.js +7 -7
- package/dist/main/CurrencyCrossTableWidget/components/CellWithData.js.map +1 -1
- package/dist/main/CurrencyCrossTableWidget/components/TextCell.js +1 -1
- package/dist/main/CurrencyCrossTableWidget/components/TextCell.js.map +1 -1
- package/dist/main/CurrencyCrossTableWidget/components/types.js.map +1 -1
- package/dist/main/CurrencyCrossTableWidget/constant.js.map +1 -1
- package/dist/main/CurrencyCrossTableWidget/index.js +8 -8
- package/dist/main/CurrencyCrossTableWidget/index.js.map +1 -1
- package/dist/main/CurrencyCrossTableWidget/render.js +6 -6
- package/dist/main/CurrencyCrossTableWidget/render.js.map +1 -1
- package/dist/main/CurrencyCrossTableWidget/types.js.map +1 -1
- package/dist/main/CurrencyCrossTableWidget/utils.js.map +1 -1
- package/dist/main/gql/types/fragment-masking.js.map +1 -1
- package/dist/main/gql/types/gql.js +1 -1
- package/dist/main/gql/types/gql.js.map +1 -1
- package/dist/main/gql/types/graphql.js +73 -73
- package/dist/main/gql/types/graphql.js.map +1 -1
- package/dist/main/gql/types/index.js.map +1 -1
- package/dist/main/gql/validateInstruments.js +4 -1
- package/dist/main/gql/validateInstruments.js.map +1 -1
- package/dist/main/translations/index.js +1 -1
- package/dist/main/translations/index.js.map +1 -1
- package/dist/main/translations/translations.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/CurrencyCrossTableWidget.js +27 -27
- package/dist/module/CurrencyCrossTableWidget/CurrencyCrossTableWidget.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/Main.js +10 -10
- package/dist/module/CurrencyCrossTableWidget/Main.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/ValidationWrapper.js +6 -6
- package/dist/module/CurrencyCrossTableWidget/ValidationWrapper.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/components/Cell.js +1 -1
- package/dist/module/CurrencyCrossTableWidget/components/Cell.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/components/CellWithData.js +7 -7
- package/dist/module/CurrencyCrossTableWidget/components/CellWithData.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/components/TextCell.js +1 -1
- package/dist/module/CurrencyCrossTableWidget/components/TextCell.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/components/types.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/constant.js +1 -1
- package/dist/module/CurrencyCrossTableWidget/constant.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/index.js +1 -1
- package/dist/module/CurrencyCrossTableWidget/index.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/render.js +6 -6
- package/dist/module/CurrencyCrossTableWidget/render.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/types.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/utils.js +1 -1
- package/dist/module/CurrencyCrossTableWidget/utils.js.map +1 -1
- package/dist/module/gql/types/fragment-masking.js.map +1 -1
- package/dist/module/gql/types/gql.js +1 -1
- package/dist/module/gql/types/gql.js.map +1 -1
- package/dist/module/gql/types/graphql.js +73 -73
- package/dist/module/gql/types/graphql.js.map +1 -1
- package/dist/module/gql/types/index.js +2 -2
- package/dist/module/gql/types/index.js.map +1 -1
- package/dist/module/gql/validateInstruments.js +4 -1
- package/dist/module/gql/validateInstruments.js.map +1 -1
- package/dist/module/translations/index.js +1 -1
- package/dist/module/translations/index.js.map +1 -1
- package/dist/module/translations/translations.js.map +1 -1
- package/dist/types/CurrencyCrossTableWidget/CurrencyCrossTableWidget.d.ts +1 -1
- package/dist/types/CurrencyCrossTableWidget/Main.d.ts +2 -2
- package/dist/types/CurrencyCrossTableWidget/ValidationWrapper.d.ts +1 -1
- package/dist/types/CurrencyCrossTableWidget/components/Cell.d.ts +1 -1
- package/dist/types/CurrencyCrossTableWidget/components/CellWithData.d.ts +1 -1
- package/dist/types/CurrencyCrossTableWidget/components/TextCell.d.ts +1 -1
- package/dist/types/CurrencyCrossTableWidget/components/types.d.ts +2 -2
- package/dist/types/CurrencyCrossTableWidget/constant.d.ts +1 -1
- package/dist/types/CurrencyCrossTableWidget/index.d.ts +1 -1
- package/dist/types/CurrencyCrossTableWidget/types.d.ts +2 -2
- package/dist/types/CurrencyCrossTableWidget/utils.d.ts +3 -3
- package/dist/types/gql/types/gql.d.ts +2 -2
- package/dist/types/gql/types/index.d.ts +2 -2
- package/dist/types/translations/index.d.ts +2 -2
- package/package.json +3 -3
- package/src/CurrencyCrossTableWidget/CurrencyCrossTableWidget.tsx +28 -31
- package/src/CurrencyCrossTableWidget/Main.tsx +21 -28
- package/src/CurrencyCrossTableWidget/ValidationWrapper.tsx +28 -21
- package/src/CurrencyCrossTableWidget/components/Cell.tsx +11 -8
- package/src/CurrencyCrossTableWidget/components/CellWithData.tsx +24 -15
- package/src/CurrencyCrossTableWidget/components/TextCell.tsx +14 -9
- package/src/CurrencyCrossTableWidget/components/types.ts +3 -2
- package/src/CurrencyCrossTableWidget/constant.ts +13 -4
- package/src/CurrencyCrossTableWidget/index.ts +1 -1
- package/src/CurrencyCrossTableWidget/render.tsx +44 -30
- package/src/CurrencyCrossTableWidget/types.tsx +3 -2
- package/src/CurrencyCrossTableWidget/utils.ts +10 -7
- package/src/gql/types/fragment-masking.ts +41 -21
- package/src/gql/types/gql.ts +7 -3
- package/src/gql/types/graphql.ts +129 -47
- package/src/gql/types/index.ts +2 -2
- package/src/gql/validateInstruments.ts +4 -1
- package/src/translations/index.ts +4 -4
- package/src/translations/translations.ts +2 -1
- package/test/Main.test.tsx +25 -11
- package/test/mocks.ts +23 -14
- package/test/utils.test.ts +119 -19
package/test/utils.test.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
currenciesToInstruments,
|
|
3
|
+
validCurrencies,
|
|
4
|
+
} from '../src/CurrencyCrossTableWidget/utils';
|
|
5
|
+
import { Division } from '../src/gql/types/graphql';
|
|
2
6
|
|
|
3
7
|
describe('validateCurrencies', () => {
|
|
4
8
|
it('should return true, same arrays', () => {
|
|
@@ -21,27 +25,123 @@ describe('validateCurrencies', () => {
|
|
|
21
25
|
describe('currenciesToInstruments', () => {
|
|
22
26
|
const currencies = ['EUR', 'USD', 'JPY', 'GBP', 'CHF', 'AUD', 'CAD', 'NZD'];
|
|
23
27
|
it('should return mapped list of currencies for OC', () => {
|
|
24
|
-
expect(currenciesToInstruments(currencies,
|
|
25
|
-
'EUR_USD',
|
|
26
|
-
'
|
|
27
|
-
'
|
|
28
|
-
'
|
|
29
|
-
'
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
'
|
|
28
|
+
expect(currenciesToInstruments(currencies, Division.Oc)).toEqual([
|
|
29
|
+
'EUR_USD',
|
|
30
|
+
'EUR_JPY',
|
|
31
|
+
'EUR_GBP',
|
|
32
|
+
'EUR_CHF',
|
|
33
|
+
'EUR_AUD',
|
|
34
|
+
'EUR_CAD',
|
|
35
|
+
'EUR_NZD',
|
|
36
|
+
'USD_EUR',
|
|
37
|
+
'USD_JPY',
|
|
38
|
+
'USD_GBP',
|
|
39
|
+
'USD_CHF',
|
|
40
|
+
'USD_AUD',
|
|
41
|
+
'USD_CAD',
|
|
42
|
+
'USD_NZD',
|
|
43
|
+
'JPY_EUR',
|
|
44
|
+
'JPY_USD',
|
|
45
|
+
'JPY_GBP',
|
|
46
|
+
'JPY_CHF',
|
|
47
|
+
'JPY_AUD',
|
|
48
|
+
'JPY_CAD',
|
|
49
|
+
'JPY_NZD',
|
|
50
|
+
'GBP_EUR',
|
|
51
|
+
'GBP_USD',
|
|
52
|
+
'GBP_JPY',
|
|
53
|
+
'GBP_CHF',
|
|
54
|
+
'GBP_AUD',
|
|
55
|
+
'GBP_CAD',
|
|
56
|
+
'GBP_NZD',
|
|
57
|
+
'CHF_EUR',
|
|
58
|
+
'CHF_USD',
|
|
59
|
+
'CHF_JPY',
|
|
60
|
+
'CHF_GBP',
|
|
61
|
+
'CHF_AUD',
|
|
62
|
+
'CHF_CAD',
|
|
63
|
+
'CHF_NZD',
|
|
64
|
+
'AUD_EUR',
|
|
65
|
+
'AUD_USD',
|
|
66
|
+
'AUD_JPY',
|
|
67
|
+
'AUD_GBP',
|
|
68
|
+
'AUD_CHF',
|
|
69
|
+
'AUD_CAD',
|
|
70
|
+
'AUD_NZD',
|
|
71
|
+
'CAD_EUR',
|
|
72
|
+
'CAD_USD',
|
|
73
|
+
'CAD_JPY',
|
|
74
|
+
'CAD_GBP',
|
|
75
|
+
'CAD_CHF',
|
|
76
|
+
'CAD_AUD',
|
|
77
|
+
'CAD_NZD',
|
|
78
|
+
'NZD_EUR',
|
|
79
|
+
'NZD_USD',
|
|
80
|
+
'NZD_JPY',
|
|
81
|
+
'NZD_GBP',
|
|
82
|
+
'NZD_CHF',
|
|
83
|
+
'NZD_AUD',
|
|
84
|
+
'NZD_CAD',
|
|
33
85
|
]);
|
|
34
86
|
});
|
|
35
87
|
it('should return mapped list of currencies for OGM', () => {
|
|
36
|
-
expect(currenciesToInstruments(currencies,
|
|
37
|
-
'EURUSD',
|
|
38
|
-
'
|
|
39
|
-
'
|
|
40
|
-
'
|
|
41
|
-
'
|
|
42
|
-
'
|
|
43
|
-
'
|
|
44
|
-
'
|
|
88
|
+
expect(currenciesToInstruments(currencies, Division.Ogm)).toEqual([
|
|
89
|
+
'EURUSD',
|
|
90
|
+
'EURJPY',
|
|
91
|
+
'EURGBP',
|
|
92
|
+
'EURCHF',
|
|
93
|
+
'EURAUD',
|
|
94
|
+
'EURCAD',
|
|
95
|
+
'EURNZD',
|
|
96
|
+
'USDEUR',
|
|
97
|
+
'USDJPY',
|
|
98
|
+
'USDGBP',
|
|
99
|
+
'USDCHF',
|
|
100
|
+
'USDAUD',
|
|
101
|
+
'USDCAD',
|
|
102
|
+
'USDNZD',
|
|
103
|
+
'JPYEUR',
|
|
104
|
+
'JPYUSD',
|
|
105
|
+
'JPYGBP',
|
|
106
|
+
'JPYCHF',
|
|
107
|
+
'JPYAUD',
|
|
108
|
+
'JPYCAD',
|
|
109
|
+
'JPYNZD',
|
|
110
|
+
'GBPEUR',
|
|
111
|
+
'GBPUSD',
|
|
112
|
+
'GBPJPY',
|
|
113
|
+
'GBPCHF',
|
|
114
|
+
'GBPAUD',
|
|
115
|
+
'GBPCAD',
|
|
116
|
+
'GBPNZD',
|
|
117
|
+
'CHFEUR',
|
|
118
|
+
'CHFUSD',
|
|
119
|
+
'CHFJPY',
|
|
120
|
+
'CHFGBP',
|
|
121
|
+
'CHFAUD',
|
|
122
|
+
'CHFCAD',
|
|
123
|
+
'CHFNZD',
|
|
124
|
+
'AUDEUR',
|
|
125
|
+
'AUDUSD',
|
|
126
|
+
'AUDJPY',
|
|
127
|
+
'AUDGBP',
|
|
128
|
+
'AUDCHF',
|
|
129
|
+
'AUDCAD',
|
|
130
|
+
'AUDNZD',
|
|
131
|
+
'CADEUR',
|
|
132
|
+
'CADUSD',
|
|
133
|
+
'CADJPY',
|
|
134
|
+
'CADGBP',
|
|
135
|
+
'CADCHF',
|
|
136
|
+
'CADAUD',
|
|
137
|
+
'CADNZD',
|
|
138
|
+
'NZDEUR',
|
|
139
|
+
'NZDUSD',
|
|
140
|
+
'NZDJPY',
|
|
141
|
+
'NZDGBP',
|
|
142
|
+
'NZDCHF',
|
|
143
|
+
'NZDAUD',
|
|
144
|
+
'NZDCAD',
|
|
45
145
|
]);
|
|
46
146
|
});
|
|
47
147
|
});
|