question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

help([google-maps]): [Working example of testing a component which uses a google map]

See original GitHub issue

Is there an example project somewhere showing how to test a component using a google-map component ? I’ve tried a lot of things, but I had to give up.

For example I tried using the following code in my beforeEach :

    mapSpy = createMapSpy(DEFAULT_OPTIONS);
    mapConstructorSpy = createMapConstructorSpy(mapSpy);

But I still get an error such as "Uncaught TypeError: googleMap.setOptions is not a function "

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
wagnermacielcommented, Aug 13, 2020

Closing because this issue has been inactive for 2 weeks or more after follow up was requested.

2reactions
sqljimcommented, Apr 9, 2020

Am having the same problem with Angular 9.1 where I’m getting ReferenceError: google is not defined in my unit tests, so I’d love to see a working example too…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Code Samples | Maps JavaScript API - Google Developers
All of the examples contained in the Maps JavaScript API documentation set are listed below for quick reference. Basics. Simple Map · Showing...
Read more >
Unit Testing Google Maps API with Jest - Atomic Spin
In our unit tests, we need to mock every Google Maps functionality that will be touched. For example, inside the displayInfoByCoord function, ...
Read more >
How to use Google Maps API with React including ... - YouTube
... learn how to use the # Google #maps inside a #React application, we will also see how to use the Places autocomplete...
Read more >
Using the Google Maps Component - Appery.io
Don't forget to set up a Google Maps API key for yourself if you haven't already. It's required for the Google Maps component...
Read more >
Google Maps, Geolocation and Unit Test on React Native
In this tutorial, we will build a Taxi App for both iOS & Android using React Native CLI. Also, we're going to dive...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found