Created
October 3, 2018 13:36
-
-
Save janhesters/19fad5cc95b2e2e9a858149eb133e485 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| describe("rendering", () => { | |
| let wrapper: ShallowWrapper; | |
| let props: Props; | |
| let Platform: PlatformStatic; | |
| beforeEach(() => { | |
| props = createTestProps({}); | |
| wrapper = shallow(<LoginScreen {...props} />); | |
| Platform = require("react-native").Platform; | |
| }); | |
| // ... other tests | |
| it("should render a <KeyboardAvoidingView />", () => { | |
| expect(wrapper.find("KeyboardAvoidingView")).toHaveLength(1); | |
| }); | |
| describe("<KeyboardAvoidingView />'s behavior on iOS", () => { | |
| beforeEach(() => { | |
| Platform.OS = "ios"; | |
| }); | |
| it("should have a 'behavior' prop of 'padding'", () => { | |
| expect(wrapper.find("KeyboardAvoidingView").prop("behavior")).toBe("padding"); | |
| }); | |
| }); | |
| describe("<KeyboardAvoidingView />'s behavior on Android", () => { | |
| beforeEach(() => { | |
| Platform.OS = "android"; | |
| }); | |
| it("should NOT have a behavior prop", () => { | |
| expect(wrapper.find("KeyboardAvoidingView").prop("behavior")).toBe(undefined); | |
| }); | |
| }); | |
| // ... more other tests |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment