Created
May 28, 2020 07:55
-
-
Save SebinLee/c8152e1e7cf34f1ae5f7ed225016b6d9 to your computer and use it in GitHub Desktop.
React Testing Recipe 번역 - Mocking Modules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import Map from "./map"; | |
function Contact(props) { | |
return ( | |
<div> | |
<address> | |
Contact {props.name} via{" "} | |
<a data-testid="email" href={"mailto:" + props.email}> | |
</a> | |
or on their <a data-testid="site" href={props.site}> | |
website | |
</a>. | |
</address> | |
<Map center={props.center} /> | |
</div> | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { LoadScript, GoogleMap } from "react-google-maps"; | |
export default function Map(props) { | |
return ( | |
<LoadScript id="script-loader" googleMapsApiKey="YOUR_API_KEY"> | |
<GoogleMap id="example-map" center={props.center} /> | |
</LoadScript> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment