Created
November 28, 2018 22:26
-
-
Save TimoGlastra/59dd81fcf9915d6066ab75e9f66ec0cf to your computer and use it in GitHub Desktop.
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 { Text } from "react-native"; | |
import App from "./App"; | |
import renderer from "react-test-renderer"; | |
describe("<App />", () => { | |
it("renders correctly", () => { | |
const tree = renderer.create(<App />).toJSON(); | |
expect(tree).toMatchSnapshot(); | |
}); | |
it("renders the correct amount of children", () => { | |
const component = renderer.create(<App />); | |
const textInstances = component.root.findAllByType(Text); | |
expect(textInstances).toHaveLength(3); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment