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

Looking for a mock for google.maps.places.AutocompleteSessionToken #495

Closed
boroth opened this issue Aug 3, 2023 · 2 comments · Fixed by #500
Closed

Looking for a mock for google.maps.places.AutocompleteSessionToken #495

boroth opened this issue Aug 3, 2023 · 2 comments · Fixed by #500
Labels
released triage me I really want to be triaged. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@boroth
Copy link

boroth commented Aug 3, 2023

Is your feature request related to a problem? Please describe.
I just updated this library to use the mocks for the AutocompleteService. However, it doesn't look like there's a mock for google.maps.places.AutocompleteSessionToken. When trying to use the react-google-places-autocomplete library with the mocks, it throws the following error:

TypeError: google.maps.places.AutocompleteSessionToken is not a constructor

Also seeing a similar issue with Geocoder when this line tries to run (https://github.com/Tintef/react-google-places-autocomplete/blob/88c8ec8893394c234899831e0b9da00f8aeb4f54/src/utils/geocode-by-address.ts#L3C1-L3C52), it gives the following error:

TypeError: Cannot read properties of undefined (reading 'OK')

Describe the solution you'd like
Would like for the AutocompleteSessionToken to be mocked.

Describe alternatives you've considered
I've considered mocking on my own, I'm just not familiar enough with what needs to be mocked within the constructor. Willing to put in a PR if I can be pointed in the right direction of documentation.

Additional context
n/a

@boroth boroth added triage me I really want to be triaged. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Aug 3, 2023
@wangela
Copy link
Member

wangela commented Aug 3, 2023

If you would like to upvote the priority of this issue, please comment below or react on the original post above with 👍 so we can see what is popular when we triage.

@boroth Thank you for opening this issue. 🙏
Please check out these other resources that might help you get to a resolution in the meantime:

This is an automated message, feel free to ignore.

usefulthink pushed a commit that referenced this issue Sep 13, 2023
Previously the `google.maps.places.AutocompleteSessionToken` class
was not mocked by this library.

Developers implementing custom autocomplete operations would likely
encounter the following error message in their tests:

```
TypeError: google.maps.places.AutocompleteSessionToken is not a constructor
```

This commit adds a mock and exports it for the `AutocompleteSessionToken`
class. The constructor accepts no parameters, and the class does not
expose any public functions/methods.

resolves: #495
github-actions bot pushed a commit that referenced this issue Sep 13, 2023
Previously the `google.maps.places.AutocompleteSessionToken` class
was not mocked by this library.

Developers implementing custom autocomplete operations would likely
encounter the following error message in their tests:

```
TypeError: google.maps.places.AutocompleteSessionToken is not a constructor
```

This commit adds a mock and exports it for the `AutocompleteSessionToken`
class. The constructor accepts no parameters, and the class does not
expose any public functions/methods.

resolves: #495 a59d1d8
googlemaps-bot pushed a commit that referenced this issue Sep 13, 2023
## [2.20.0](v2.19.4...v2.20.0) (2023-09-13)

### Features

* **autocomplete:** Add AutocompleteSessionToken ([#500](#500)) ([a59d1d8](a59d1d8)), closes [#495](#495)

### Miscellaneous Chores

* **deps-dev:** bump @rollup/plugin-typescript from 11.1.2 to 11.1.3 ([#511](#511)) ([fb9a1a8](fb9a1a8))
@googlemaps-bot
Copy link
Contributor

🎉 This issue has been resolved in version 2.20.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released triage me I really want to be triaged. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants