From 966cf98759ae56e6df24788ab63c3543bb6e56e1 Mon Sep 17 00:00:00 2001 From: nandoacoelho Date: Thu, 27 Jun 2019 17:30:58 -0300 Subject: [PATCH] Update unit tests --- .babelrc | 38 ------------------- .../GetAddressByGeolocation.test.js | 2 +- react/geolocation/Utils.js | 2 +- 3 files changed, 2 insertions(+), 40 deletions(-) delete mode 100644 .babelrc diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 9d5875c7..00000000 --- a/.babelrc +++ /dev/null @@ -1,38 +0,0 @@ -{ - "presets": [ - [ - "/Users/fernandocoelho/Code/address-form/node_modules/nwb/node_modules/babel-preset-env/lib/index.js", - { - "loose": true, - "modules": "commonjs" - } - ], - "/Users/fernandocoelho/Code/address-form/node_modules/babel-preset-react/lib/index.js", - "/Users/fernandocoelho/Code/address-form/node_modules/babel-preset-stage-1/lib/index.js" - ], - "plugins": [ - "/Users/fernandocoelho/Code/address-form/node_modules/babel-plugin-transform-decorators-legacy/lib/index.js", - "add-react-displayname", - [ - "/Users/fernandocoelho/Code/address-form/node_modules/babel-plugin-transform-react-remove-prop-types/lib/index.js", - { - "mode": "wrap" - } - ], - [ - "/Users/fernandocoelho/Code/address-form/node_modules/babel-plugin-transform-runtime/lib/index.js", - { - "helpers": false, - "polyfill": false, - "regenerator": true - } - ], - "/Users/fernandocoelho/Code/address-form/node_modules/babel-plugin-add-module-exports/lib/index.js" - ], - "ignore": [ - ".spec.js", - ".test.js", - "-test.js", - "/__tests__/" - ] -} \ No newline at end of file diff --git a/react/geolocation/GetAddressByGeolocation.test.js b/react/geolocation/GetAddressByGeolocation.test.js index b73ecdd5..13ec2973 100644 --- a/react/geolocation/GetAddressByGeolocation.test.js +++ b/react/geolocation/GetAddressByGeolocation.test.js @@ -16,7 +16,7 @@ describe('Get Address by Geolocation', () => { expect(mockFn).toHaveBeenCalledWith( { - address: '321 Praia de Botafogo', + address: '321 Praia de Botafogo Rio de Janeiro RJ', componentRestrictions: { country: 'EC' }, }, expect.any(Function), diff --git a/react/geolocation/Utils.js b/react/geolocation/Utils.js index c32abf5d..bf553137 100644 --- a/react/geolocation/Utils.js +++ b/react/geolocation/Utils.js @@ -13,7 +13,7 @@ export default function getAddressByGeolocation(geolocationProps) { componentRestrictions: { country: rules.abbr, }, - address: `${address['number'].value} ${address['street'].value} ${address['city'].value} ${address['state'].value}`, + address: `${address['number'].value || ''} ${address['street'].value || ''} ${address['city'].value || ''} ${address['state'].value || ''}`, }, (results, status) => { if (status === googleMaps.GeocoderStatus.OK) {