Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add testing for MapModule's proper construction #4717

Closed
rexagod opened this issue Jan 28, 2019 · 4 comments · Fixed by publiclab/PublicLab.Editor#269
Closed

Add testing for MapModule's proper construction #4717

rexagod opened this issue Jan 28, 2019 · 4 comments · Fixed by publiclab/PublicLab.Editor#269
Labels
bug the issue is regarding one of our programs which faces problems when a certain task is executed discussion testing issues are usually for adding unit tests, integration tests or any other tests for a feature

Comments

@rexagod
Copy link
Member

rexagod commented Jan 28, 2019

Aims to identify issue #4714 if it happens again. I think we can check to see if the code below throws an error or not.

     _module.blurredLocation.panMapToGeocodedLocation("placenameInput") ;

Reference - #4714 (comment)

@rexagod rexagod added bug the issue is regarding one of our programs which faces problems when a certain task is executed testing issues are usually for adding unit tests, integration tests or any other tests for a feature discussion labels Jan 28, 2019
@sagarpreet-chadha
Copy link
Contributor

Hi @rexagod !

panMapToGeocodedLocation this function of LBL uses Google API .

The error in #4714 was due to script not being loaded .

  • I guess we can write a test to confirm that the script is being loaded or not before the actual loading of the page content , that would make us more confident that this will not happen again

See this comment here (i changed the code where we were loading script earlier) :
#4608 (comment)

  • Also , in LBL if we can write some if condition in the panMapToGeocodedLocation function when it uses the google API's function --- to check if that function exists or not !

What do you think ? Would you like to work with me on this one ?
Thanks 😄 !

@jywarren
Copy link
Member

jywarren commented Jan 29, 2019 via email

@rexagod
Copy link
Member Author

rexagod commented Jan 31, 2019

Okay it seems there may be two possible approaches here.

  • Check if google is defined and execute this code only if it is. This may not give expected results if we decide to include other google API's in the future and one of those fails, throwing the same error.
  • Since the above code was in the error stack when this happened, we can search the Error.prototype.stack for the same.

@jywarren
Copy link
Member

jywarren commented Jan 31, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug the issue is regarding one of our programs which faces problems when a certain task is executed discussion testing issues are usually for adding unit tests, integration tests or any other tests for a feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants