MCPcopy Create free account
hub / github.com/angular/components / createInfoWindowSpy

Function createInfoWindowSpy

src/google-maps/testing/fake-google-map-utils.ts:190–210  ·  view source on GitHub ↗
(
  options: google.maps.InfoWindowOptions,
)

Source from the content-addressed store, hash-verified

188
189/** Creates a jasmine.SpyObj for a google.maps.InfoWindow */
190export 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 */
213export function createInfoWindowConstructorSpy(

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected