react-google-maps-api icon indicating copy to clipboard operation
react-google-maps-api copied to clipboard

How can i make test?

Open misaku opened this issue 2 years ago • 3 comments

i cant understand how can i make test with jest.

misaku avatar Dec 23 '22 21:12 misaku

same question!

ranggabadrus avatar Jan 15 '23 05:01 ranggabadrus

Not possible to unit Test.

JustFly1984 avatar Feb 01 '23 02:02 JustFly1984

Do as follow:

jest.mock('@react-google-maps/api', () => {
  return {
    withGoogleMap: (Component: any) => Component,
    withScriptjs: (Component: any) => Component,
    Marker: (props: any) => <div {...props} />,
    GoogleMap: (props: any) => (
      <div>
        <div className="mock-google-maps" />
        {props.children}
      </div>
    ),
    InfoWindow: (props: any) => <div {...props} />,
    useLoadScript: () => ({
      isLoaded: true
    })
  }
})

murilogok avatar Jun 14 '23 16:06 murilogok