UNPKG

react-native-image-layout

Version:

An easy and simple to use React Native component to render a custom masonry layout for remote/local images and displayed on a custom interactive image viewer. Includes animations and support for both iOS and Android. Free and made possible along with co

19 lines (14 loc) 526 B
import "react-native"; import React from "react"; import { data } from "./mocks/dataMock"; import ImageLayout from "./../src/"; // Note: test renderer must be required after react-native. import renderer from "react-test-renderer"; test("Image Layout renders correctly", () => { const imageLayout = renderer.create(<ImageLayout images={data} />).toJSON(); const scrollView = imageLayout.children[0]; expect(scrollView.type).toBe("View"); expect(imageLayout.props.images.length).toBeGreaterThan(0); });