UNPKG

react-native-tableview-simple

Version:

React Native component for TableView made with pure CSS

46 lines 2.45 kB
/* eslint-env node, jest */ import 'react-native'; import React from 'react'; import renderer from 'react-test-renderer'; import { Cell, Section, TableView } from '../../index'; it('renders basic', () => { const tree = renderer .create(React.createElement(TableView, null, React.createElement(Section, { footer: "All rights reserved." }, React.createElement(Cell, { title: "Help / FAQ", titleTextColor: "#007AFF", onPress: () => console.log('open Help/FAQ') }), React.createElement(Cell, { title: "Contact Us", titleTextColor: "#007AFF", onPress: () => console.log('open Contact Us') }), null))) .toJSON(); expect(tree).toMatchSnapshot(); }); it('renders with appearance auto', () => { const tree = renderer .create(React.createElement(TableView, { appearance: "auto" }, React.createElement(Section, { footer: "All rights reserved." }, React.createElement(Cell, { title: "Help / FAQ", titleTextColor: "#007AFF", onPress: () => console.log('open Help/FAQ') }), React.createElement(Cell, { title: "Contact Us", titleTextColor: "#007AFF", onPress: () => console.log('open Contact Us') }), null))) .toJSON(); expect(tree).toMatchSnapshot(); }); it('renders with appearance light', () => { const tree = renderer .create(React.createElement(TableView, { appearance: "light" }, React.createElement(Section, { footer: "All rights reserved." }, React.createElement(Cell, { title: "Help / FAQ", titleTextColor: "#007AFF", onPress: () => console.log('open Help/FAQ') }), React.createElement(Cell, { title: "Contact Us", titleTextColor: "#007AFF", onPress: () => console.log('open Contact Us') }), null))) .toJSON(); expect(tree).toMatchSnapshot(); }); it('renders with appearance dark', () => { const tree = renderer .create(React.createElement(TableView, { appearance: "dark" }, React.createElement(Section, { footer: "All rights reserved." }, React.createElement(Cell, { title: "Help / FAQ", titleTextColor: "#007AFF", onPress: () => console.log('open Help/FAQ') }), React.createElement(Cell, { title: "Contact Us", titleTextColor: "#007AFF", onPress: () => console.log('open Contact Us') }), null))) .toJSON(); expect(tree).toMatchSnapshot(); }); //# sourceMappingURL=TableView.test.js.map