|
| 1 | +/** |
| 2 | + * Copyright 2022 Google LLC. All Rights Reserved. |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +/* eslint-disable @typescript-eslint/no-empty-function */ |
| 18 | +/* eslint-disable @typescript-eslint/no-unused-vars */ |
| 19 | + |
| 20 | +import { __registerMockInstance } from "../../registry"; |
| 21 | + |
| 22 | +export class PlacesService implements google.maps.places.PlacesService { |
| 23 | + public findPlaceFromPhoneNumber = jest.fn().mockImplementation( |
| 24 | + ( |
| 25 | + request: google.maps.places.FindPlaceFromPhoneNumberRequest, |
| 26 | + callback: ( |
| 27 | + placesResult?: Array<google.maps.places.PlaceResult>, |
| 28 | + // @ts-expect-error |
| 29 | + placeServiceStatus: google.maps.places.PlacesServiceStatus |
| 30 | + ) => void |
| 31 | + ): void => {} |
| 32 | + ); |
| 33 | + |
| 34 | + public findPlaceFromQuery = jest.fn().mockImplementation( |
| 35 | + ( |
| 36 | + request: google.maps.places.FindPlaceFromQueryRequest, |
| 37 | + callback: ( |
| 38 | + placeResult?: Array<google.maps.places.PlaceResult>, |
| 39 | + // @ts-expect-error |
| 40 | + placeServiceStatus: google.maps.places.PlacesServiceStatus |
| 41 | + ) => void |
| 42 | + ): void => {} |
| 43 | + ); |
| 44 | + |
| 45 | + public getDetails = jest.fn().mockImplementation( |
| 46 | + ( |
| 47 | + request: google.maps.places.PlaceDetailsRequest, |
| 48 | + callback: ( |
| 49 | + placeResult?: Array<google.maps.places.PlaceResult>, |
| 50 | + // @ts-expect-error |
| 51 | + placeServiceStatus: google.maps.places.PlacesServiceStatus |
| 52 | + ) => void |
| 53 | + ): void => {} |
| 54 | + ); |
| 55 | + |
| 56 | + public nearbySearch = jest.fn().mockImplementation( |
| 57 | + ( |
| 58 | + request: google.maps.places.PlaceSearchRequest, |
| 59 | + callback: ( |
| 60 | + placeResult?: Array<google.maps.places.PlaceResult>, |
| 61 | + // @ts-expect-error |
| 62 | + placesServiceStatus: google.maps.places.PlacesServiceStatus, |
| 63 | + pagination?: google.maps.places.PlaceSearchPagination |
| 64 | + ) => void |
| 65 | + ): void => {} |
| 66 | + ); |
| 67 | + |
| 68 | + public textSearch = jest.fn().mockImplementation( |
| 69 | + ( |
| 70 | + request: google.maps.places.TextSearchRequest, |
| 71 | + callback: ( |
| 72 | + placeResult?: Array<google.maps.places.PlaceResult>, |
| 73 | + // @ts-expect-error |
| 74 | + placesServiceStatus: google.maps.places.PlacesServiceStatus, |
| 75 | + pagination?: google.maps.places.PlaceSearchPagination |
| 76 | + ) => void |
| 77 | + ): void => {} |
| 78 | + ); |
| 79 | + |
| 80 | + constructor(attrContainer: HTMLDivElement | null) { |
| 81 | + __registerMockInstance(this.constructor, this); |
| 82 | + } |
| 83 | +} |
0 commit comments