UNPKG

@applicaster/zapp-react-native-ui-components

Version:

Applicaster Zapp React Native ui components for the Quick Brick App

45 lines (37 loc) 890 B
import React from "react"; import { Text, View } from "react-native"; import { shallow } from "enzyme"; import { shallowToJson } from "enzyme-to-json"; import { TransitionerComponent } from "../Transitioner"; const children = ( <View foo="bar"> <Text bar="baz">children</Text> </View> ); const transitionConfig = jest.fn(() => { return { push: {}, }; }); const transitionerComponentProps = { navigator: { previousAction: "push", pathname: "/foo", }, transitionConfig, layoutData: { isTablet: false, isTabletPortrait: false, }, }; jest.mock("uuid"); describe("<TransitionerComponent />", () => { it("renders correctly", () => { const wrapper = shallow( <TransitionerComponent {...transitionerComponentProps}> {children} </TransitionerComponent> ); expect(shallowToJson(wrapper)).toMatchSnapshot(); }); });