Skip to content

Commit e3b9e99

Browse files
committed
Improvement of our custom <Link> and <NavLink>
It should fix a bunch of issues.
1 parent c131a23 commit e3b9e99

File tree

12 files changed

+330
-259
lines changed

12 files changed

+330
-259
lines changed

.exchange-rates.cache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"disclaimer":"Usage subject to terms: https://openexchangerates.org/terms","license":"https://openexchangerates.org/license","timestamp":1510660800,"base":"USD","rates":{"AED":3.673035,"AFN":68.597,"ALL":113.85,"AMD":486.63,"ANG":1.781857,"AOA":165.9225,"ARS":17.4983,"AUD":1.310161,"AWG":1.786752,"AZN":1.6985,"BAM":1.675741,"BBD":2,"BDT":83.182854,"BGN":1.668204,"BHD":0.3771,"BIF":1749.6,"BMD":1,"BND":1.361332,"BOB":6.897686,"BRL":3.275566,"BSD":1,"BTC":0.000153485025,"BTN":65.285278,"BWP":10.652864,"BYN":1.991423,"BZD":2.00644,"CAD":1.272935,"CDF":1562.881563,"CHF":0.994715,"CLF":0.02337,"CLP":628.8,"CNH":6.642966,"CNY":6.6377,"COP":3016.02,"CRC":568.605,"CUC":1,"CUP":25.5,"CVE":94.875,"CZK":21.80415,"DJF":178.935,"DKK":6.34693,"DOP":47.937867,"DZD":114.839,"EGP":17.6438,"ERN":15.191062,"ETB":27.169609,"EUR":0.852965,"FJD":2.074747,"FKP":0.762659,"GBP":0.762659,"GEL":2.537872,"GGP":0.762659,"GHS":4.4458,"GIP":0.762659,"GMD":47.29,"GNF":9013.95,"GTQ":7.326984,"GYD":207.46247,"HKD":7.80295,"HNL":23.606507,"HRK":6.441595,"HTG":63.603697,"HUF":265.94,"IDR":13534.080047,"ILS":3.547927,"IMP":0.762659,"INR":65.505,"IQD":1164.9,"IRR":34716.946723,"ISK":103.37,"JEP":0.762659,"JMD":126.505,"JOD":0.709001,"JPY":113.65166667,"KES":103.575,"KGS":69.131479,"KHR":4032.45,"KMF":422,"KPW":900,"KRW":1114.6325,"KWD":0.302158,"KYD":0.831775,"KZT":332.5,"LAK":8311.2,"LBP":1513.25,"LKR":153.61,"LRD":123.1,"LSL":14.476277,"LYD":1.365546,"MAD":9.458954,"MDL":17.649228,"MGA":3154.35,"MKD":52.554726,"MMK":1352.75,"MNT":2450.285781,"MOP":8.018738,"MRO":354.53,"MUR":34.22,"MVR":15.390384,"MWK":725.575,"MXN":19.07835,"MYR":4.189799,"MZN":60.664443,"NAD":14.3872,"NGN":359.36,"NIO":30.693726,"NOK":8.183736,"NPR":104.452204,"NZD":1.455646,"OMR":0.384948,"PAB":1,"PEN":3.24124,"PGK":3.199082,"PHP":51.1545,"PKR":105.22,"PLN":3.612257,"PYG":5645.8,"QAR":3.641458,"RON":3.962907,"RSD":101.01,"RUB":59.7679,"RWF":853.025,"SAR":3.750377,"SBD":7.792911,"SCR":13.404244,"SDG":6.664846,"SEK":8.428474,"SGD":1.360954,"SHP":0.762659,"SLL":7643.328121,"SOS":577.475,"SRD":7.448,"SSP":130.2634,"STD":20847.000286,"SVC":8.734183,"SYP":514.98999,"SZL":14.483364,"THB":33.075,"TJS":8.794373,"TMT":3.499972,"TND":2.503786,"TOP":2.268632,"TRY":3.86834,"TTD":6.750494,"TWD":30.173,"TZS":2247.4,"UAH":26.453,"UGX":3631.5,"USD":1,"UYU":29.244046,"UZS":8053.2,"VEF":10.069908,"VND":22717.219974,"VUV":106.743333,"WST":2.54764,"XAF":559.508266,"XAG":0.05904939,"XAU":0.00078548,"XCD":2.70255,"XDR":0.712471,"XOF":559.508266,"XPD":0.00100912,"XPF":101.785782,"XPT":0.00107586,"YER":250.294142,"ZAR":14.377882,"ZMW":9.907,"ZWL":322.355011}}
1+
{"disclaimer":"Usage subject to terms: https://openexchangerates.org/terms","license":"https://openexchangerates.org/license","timestamp":1510704000,"base":"USD","rates":{"AED":3.672695,"AFN":68.727167,"ALL":113.761168,"AMD":485.395,"ANG":1.784844,"AOA":165.9225,"ARS":17.482,"AUD":1.3107,"AWG":1.786752,"AZN":1.6985,"BAM":1.668092,"BBD":2,"BDT":82.869538,"BGN":1.658473,"BHD":0.377243,"BIF":1756.530443,"BMD":1,"BND":1.360586,"BOB":6.925025,"BRL":3.3133,"BSD":1,"BTC":0.000151623274,"BTN":64.988233,"BWP":10.603594,"BYN":1.989348,"BZD":2.009837,"CAD":1.273821,"CDF":1571.940781,"CHF":0.989738,"CLF":0.02346,"CLP":631.478442,"CNH":6.632875,"CNY":6.637,"COP":3016.673333,"CRC":569.678642,"CUC":1,"CUP":25.5,"CVE":94.1625,"CZK":21.717508,"DJF":178.77,"DKK":6.310636,"DOP":47.706496,"DZD":114.75,"EGP":17.6615,"ERN":15.331062,"ETB":27.165235,"EUR":0.848119,"FJD":2.064457,"FKP":0.760023,"GBP":0.760023,"GEL":2.484908,"GGP":0.760023,"GHS":4.456016,"GIP":0.760023,"GMD":47.4,"GNF":9011.383333,"GTQ":7.339334,"GYD":207.987754,"HKD":7.8033,"HNL":23.493193,"HRK":6.4067,"HTG":62.796648,"HUF":264.45,"IDR":13534.080047,"ILS":3.535935,"IMP":0.760023,"INR":65.4216,"IQD":1161.434957,"IRR":34716.946723,"ISK":103.46,"JEP":0.760023,"JMD":125.409645,"JOD":0.709001,"JPY":113.41683333,"KES":103.695,"KGS":69.131479,"KHR":4005.95,"KMF":417.479451,"KPW":900,"KRW":1116.81,"KWD":0.302178,"KYD":0.833266,"KZT":332.283721,"LAK":8272.3,"LBP":1505.362443,"LKR":152.607899,"LRD":124.159075,"LSL":14.292216,"LYD":1.37271,"MAD":9.425238,"MDL":17.619678,"MGA":3167.926613,"MKD":52.30978,"MMK":1351.598174,"MNT":2450.115814,"MOP":8.036419,"MRO":352.84379,"MUR":34.199,"MVR":15.379923,"MWK":724.983277,"MXN":19.163075,"MYR":4.191292,"MZN":60.994761,"NAD":14.291719,"NGN":357.334053,"NIO":30.708195,"NOK":8.185274,"NPR":104.017334,"NZD":1.453894,"OMR":0.384781,"PAB":1,"PEN":3.242617,"PGK":3.191923,"PHP":51.13782,"PKR":104.616997,"PLN":3.60348,"PYG":5718.954248,"QAR":3.8003,"RON":3.937706,"RSD":100.485,"RUB":60.3391,"RWF":848.275575,"SAR":3.75045,"SBD":7.808111,"SCR":13.899,"SDG":6.675865,"SEK":8.402655,"SGD":1.359048,"SHP":0.760023,"SLL":7643.328121,"SOS":575.008879,"SRD":7.448,"SSP":130.2634,"STD":20785.849895,"SVC":8.749593,"SYP":514.98999,"SZL":14.288634,"THB":33.06,"TJS":8.802085,"TMT":3.499986,"TND":2.488196,"TOP":2.254482,"TRY":3.889481,"TTD":6.686643,"TWD":30.176,"TZS":2247.45,"UAH":26.496426,"UGX":3637.566138,"USD":1,"UYU":29.342609,"UZS":8072.85,"VEF":10.17675,"VND":22715.986641,"VUV":106.343332,"WST":2.52584,"XAF":556.329697,"XAG":0.05870637,"XAU":0.00078064,"XCD":2.70255,"XDR":0.711022,"XOF":556.329697,"XPD":0.00100985,"XPF":101.207536,"XPT":0.00107887,"YER":250.306642,"ZAR":14.3756,"ZMW":9.935551,"ZWL":322.355011}}

__tests__/shared/components/TopcoderHeader/desktop/SubMenu/__snapshots__/Item.jsx.snap

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,17 @@ exports[`Matches shallow shapshot 1`] = `
77
role="button"
88
tabIndex={0}
99
>
10-
<Connect(RRLinkWrapper)
10+
<Link
11+
className={null}
12+
enforceA={false}
13+
onClick={null}
14+
openNewTab={false}
15+
replace={false}
1116
to="menu url"
1217
>
1318
icon url
1419
title
15-
</Connect(RRLinkWrapper)>
20+
</Link>
1621
</li>
1722
`;
1823

@@ -23,11 +28,16 @@ exports[`Matches shallow shapshot 2`] = `
2328
role="button"
2429
tabIndex={0}
2530
>
26-
<Connect(RRLinkWrapper)
31+
<Link
32+
className={null}
33+
enforceA={false}
34+
onClick={null}
35+
openNewTab={false}
36+
replace={false}
2737
to="menu url"
2838
>
2939
icon url
3040
title
31-
</Connect(RRLinkWrapper)>
41+
</Link>
3242
</li>
3343
`;

__tests__/shared/components/__snapshots__/Content.jsx.snap

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,14 @@ exports[`Matches shallow shapshot 1`] = `
420420
</Link>
421421
- A simple showcase of the fonts included into this repo, and the test of their proper inclusion into the bundle;
422422
</li>
423+
<li>
424+
<Link
425+
replace={false}
426+
to="/examples/link-test"
427+
>
428+
Link Test
429+
</Link>
430+
</li>
423431
<li>
424432
<Link
425433
replace={false}

__tests__/shared/components/challenge-listing/ChallengeCard/index.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import MockDate from 'mockdate';
77
import { Provider } from 'react-redux';
88
import mockReduxStore from 'redux-mock-store';
99
import { Tag } from 'components/tags';
10+
import { StaticRouter } from 'react-router-dom';
1011

1112
const store = mockReduxStore()();
1213

@@ -144,7 +145,9 @@ class Wrapper extends React.Component {
144145
render() {
145146
return (
146147
<Provider store={store}>
147-
<ChallengeCard {...this.props} />
148+
<StaticRouter context={{}}>
149+
<ChallengeCard {...this.props} />
150+
</StaticRouter>
148151
</Provider>
149152
);
150153
}

__tests__/shared/components/challenge-listing/Listing/Bucket.jsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import TU from 'react-dom/test-utils';
66
import Bucket from 'components/challenge-listing/Listing/Bucket';
77
import reduxStoreFactory from 'redux-mock-store';
88
import { Provider } from 'react-redux';
9+
import { StaticRouter } from 'react-router-dom';
910
import { Tag } from 'components/tags';
1011

1112
const store = reduxStoreFactory()();
@@ -169,7 +170,9 @@ test('Matches shallow shapshot', () => {
169170
_.forEach(mockDatas, (data) => {
170171
renderer.render((
171172
<Provider store={store}>
172-
<Bucket {...data} />
173+
<StaticRouter context={{}}>
174+
<Bucket {...data} />
175+
</StaticRouter>
173176
</Provider>
174177
));
175178
expect(renderer.getRenderOutput()).toMatchSnapshot();
@@ -182,7 +185,9 @@ class Wrapper extends React.Component {
182185
render() {
183186
return (
184187
<Provider store={store}>
185-
<Bucket {...this.props} />
188+
<StaticRouter context={{}}>
189+
<Bucket {...this.props} />
190+
</StaticRouter>
186191
</Provider>
187192
);
188193
}

0 commit comments

Comments
 (0)