( options: google.maps.InfoWindowOptions, )
| 188 | |
| 189 | /** Creates a jasmine.SpyObj for a google.maps.InfoWindow */ |
| 190 | export function createInfoWindowSpy( |
| 191 | options: google.maps.InfoWindowOptions, |
| 192 | ): jasmine.SpyObj<google.maps.InfoWindow> { |
| 193 | let anchor: any; |
| 194 | const infoWindowSpy = jasmine.createSpyObj('google.maps.InfoWindow', [ |
| 195 | 'addListener', |
| 196 | 'close', |
| 197 | 'getContent', |
| 198 | 'getPosition', |
| 199 | 'getZIndex', |
| 200 | 'open', |
| 201 | 'get', |
| 202 | 'setOptions', |
| 203 | 'setPosition', |
| 204 | ]); |
| 205 | infoWindowSpy.addListener.and.returnValue({remove: () => {}}); |
| 206 | infoWindowSpy.open.and.callFake((config: any) => (anchor = config.anchor)); |
| 207 | infoWindowSpy.close.and.callFake(() => (anchor = null)); |
| 208 | infoWindowSpy.get.and.callFake((key: string) => (key === 'anchor' ? anchor : null)); |
| 209 | return infoWindowSpy; |
| 210 | } |
| 211 | |
| 212 | /** Creates a jasmine.Spy to watch for the constructor of a google.maps.InfoWindow */ |
| 213 | export function createInfoWindowConstructorSpy( |
no outgoing calls
no test coverage detected