-
Notifications
You must be signed in to change notification settings - Fork 32
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
Testing: Mock the google maps geocoding API in Jasmine #235
Conversation
I figured out how to move it to a helper file! The existing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FANTASTIC!!!
@@ -29,7 +29,7 @@ module.exports = function Interface (options) { | |||
options.onDrag = options.onDrag || function onDrag() { | |||
function onPlacenameReturned(result) { | |||
result = (result) ? result : options.placenameDisplayOnError; // this makes jasmine pass, other formats don't | |||
$("#"+options.placenameDisplayId).val(result); | |||
$("#"+options.placenameDisplayId).val(result.trim()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
I have added error checks in If this works properly it SHOULD mean that my fixes in LBLD and LEL are no longer needed! This should mean no warnings or errors even when there's no google api key given. |
Awesome! |
@jywarren This is all set to merge! And once merged can you publish to npm? |
Sorry I missed this! Doing it now, thank you!!! |
Done! |
#233
Be aware that if the google maps api ever changes we will also have to change our mock object in testing.
I suspect I will have to do a similar mock/stub in LBLD and possibly LEL to correct the same error with the blurredLocation object in testing.