Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Commit

Permalink
fix: pick google maps version (#1540)
Browse files Browse the repository at this point in the history
* fix(GoogleMapsLoader): pick the quarterly version

* fix(stories): pick the weekly version for the stories
  • Loading branch information
samouss committed Aug 29, 2018
1 parent bfbed9b commit b14efcf
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class GoogleMapsLoader extends Component {
};

static defaultProps = {
endpoint: 'https://maps.googleapis.com/maps/api/js?v=3.31',
endpoint: 'https://maps.googleapis.com/maps/api/js?v=quarterly',
};

state = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('GoogleMapsLoader', () => {

return flushPendingMicroTasks().then(() => {
expect(injectScript).toHaveBeenLastCalledWith(
'https://maps.googleapis.com/maps/api/js?v=3.31&key=API_KEY',
'https://maps.googleapis.com/maps/api/js?v=quarterly&key=API_KEY',
expect.any(Function)
);
});
Expand All @@ -45,7 +45,7 @@ describe('GoogleMapsLoader', () => {

return flushPendingMicroTasks().then(() => {
expect(injectScript).toHaveBeenLastCalledWith(
'https://maps.googleapis.com/maps/api/js?v=3.31&key=CUSTOM_API_KEY',
'https://maps.googleapis.com/maps/api/js?v=quarterly&key=CUSTOM_API_KEY',
expect.any(Function)
);
});
Expand Down
33 changes: 17 additions & 16 deletions stories/GeoSearch.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Container.propTypes = {
};

const apiKey = 'AIzaSyBawL8VbstJDdU5397SUX7pEt9DslAwWgQ';
const endpoint = 'https://maps.googleapis.com/maps/api/js?v=weekly';
const initialZoom = 12;
const initialPosition = {
lat: 40.71,
Expand All @@ -42,7 +43,7 @@ stories
<Configure aroundLatLngViaIP hitsPerPage={20} />

<Container>
<GoogleMapsLoader apiKey={apiKey}>
<GoogleMapsLoader apiKey={apiKey} endpoint={endpoint}>
{google => (
<GeoSearch google={google}>
{({ hits }) => (
Expand Down Expand Up @@ -70,7 +71,7 @@ stories
<Configure aroundLatLngViaIP hitsPerPage={20} />

<Container>
<GoogleMapsLoader apiKey={apiKey}>
<GoogleMapsLoader apiKey={apiKey} endpoint={endpoint}>
{google => (
<GeoSearch
google={google}
Expand Down Expand Up @@ -110,7 +111,7 @@ stories
<Configure aroundLatLngViaIP hitsPerPage={20} />

<Container>
<GoogleMapsLoader apiKey={apiKey}>
<GoogleMapsLoader apiKey={apiKey} endpoint={endpoint}>
{google => (
<GeoSearch
google={google}
Expand Down Expand Up @@ -146,7 +147,7 @@ stories
<Configure aroundLatLngViaIP hitsPerPage={20} />

<Container>
<GoogleMapsLoader apiKey={apiKey}>
<GoogleMapsLoader apiKey={apiKey} endpoint={endpoint}>
{google => (
<GeoSearch
google={google}
Expand Down Expand Up @@ -178,7 +179,7 @@ stories
<Configure aroundLatLngViaIP hitsPerPage={20} />

<Container>
<GoogleMapsLoader apiKey={apiKey}>
<GoogleMapsLoader apiKey={apiKey} endpoint={endpoint}>
{google => (
<GeoSearch google={google} streetViewControl>
{({ hits }) => (
Expand Down Expand Up @@ -206,7 +207,7 @@ stories
<Configure aroundLatLngViaIP hitsPerPage={20} />

<Container>
<GoogleMapsLoader apiKey={apiKey}>
<GoogleMapsLoader apiKey={apiKey} endpoint={endpoint}>
{google => (
<GeoSearch google={google}>
{({ hits }) => (
Expand Down Expand Up @@ -239,7 +240,7 @@ stories
<Configure aroundLatLngViaIP hitsPerPage={20} />

<Container>
<GoogleMapsLoader apiKey={apiKey}>
<GoogleMapsLoader apiKey={apiKey} endpoint={endpoint}>
{google => (
<GeoSearch google={google}>
{({ hits }) => (
Expand Down Expand Up @@ -271,7 +272,7 @@ stories
<Configure aroundLatLngViaIP hitsPerPage={20} />

<Container>
<GoogleMapsLoader apiKey={apiKey}>
<GoogleMapsLoader apiKey={apiKey} endpoint={endpoint}>
{google => (
<GeoSearch google={google} enableRefineOnMapMove={false}>
{({ hits }) => (
Expand Down Expand Up @@ -301,7 +302,7 @@ stories
<Configure aroundLatLngViaIP hitsPerPage={20} />

<Container>
<GoogleMapsLoader apiKey={apiKey}>
<GoogleMapsLoader apiKey={apiKey} endpoint={endpoint}>
{google => (
<GeoSearch google={google}>
{({ hits }) => (
Expand Down Expand Up @@ -331,7 +332,7 @@ stories
<Configure aroundLatLngViaIP hitsPerPage={20} />

<Container>
<GoogleMapsLoader apiKey={apiKey}>
<GoogleMapsLoader apiKey={apiKey} endpoint={endpoint}>
{google => (
<GeoSearch google={google} enableRefineOnMapMove={false}>
{({ hits }) => (
Expand Down Expand Up @@ -361,7 +362,7 @@ stories
<Configure aroundLatLngViaIP hitsPerPage={20} />

<Container>
<GoogleMapsLoader apiKey={apiKey}>
<GoogleMapsLoader apiKey={apiKey} endpoint={endpoint}>
{google => (
<GeoSearch google={google}>
{({ hits }) => (
Expand Down Expand Up @@ -399,7 +400,7 @@ stories
<Configure aroundLatLngViaIP hitsPerPage={20} />

<Container>
<GoogleMapsLoader apiKey={apiKey}>
<GoogleMapsLoader apiKey={apiKey} endpoint={endpoint}>
{google => (
<GeoSearch google={google}>
{({ hits }) => (
Expand Down Expand Up @@ -447,7 +448,7 @@ stories.addWithJSX(
/>

<Container>
<GoogleMapsLoader apiKey={apiKey}>
<GoogleMapsLoader apiKey={apiKey} endpoint={endpoint}>
{google => (
<GeoSearch google={google} initialZoom={12}>
{({ hits }) => (
Expand Down Expand Up @@ -521,7 +522,7 @@ stories.addWithJSX('with InfoWindow', () => {
}

return (
<GoogleMapsLoader apiKey={apiKey}>
<GoogleMapsLoader apiKey={apiKey} endpoint={endpoint}>
{google => <Example google={google} />}
</GoogleMapsLoader>
);
Expand Down Expand Up @@ -607,7 +608,7 @@ stories.addWithJSX('with hits communication (custom)', () => {
<Configure aroundLatLngViaIP hitsPerPage={20} />

<Container>
<GoogleMapsLoader apiKey={apiKey}>
<GoogleMapsLoader apiKey={apiKey} endpoint={endpoint}>
{google => (
<GeoSearch google={google}>
{({ hits }) => (
Expand Down Expand Up @@ -649,7 +650,7 @@ stories.addWithJSX('with unmount', () => {

{visible && (
<Container>
<GoogleMapsLoader apiKey={apiKey}>
<GoogleMapsLoader apiKey={apiKey} endpoint={endpoint}>
{google => (
<GeoSearch google={google}>
{({ hits }) => (
Expand Down

0 comments on commit b14efcf

Please sign in to comment.