react-native-tableview-simple
Version:
React Native component for TableView made with pure CSS
59 lines • 2.7 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
/* eslint-env node, jest */
require("react-native");
const react_1 = __importDefault(require("react"));
const react_test_renderer_1 = __importDefault(require("react-test-renderer"));
const index_1 = require("../../index");
it('renders basic', () => {
const tree = react_test_renderer_1.default
.create(<index_1.TableView>
<index_1.Section footer="All rights reserved.">
<index_1.Cell title="Help / FAQ" titleTextColor="#007AFF" onPress={() => console.log('open Help/FAQ')}/>
<index_1.Cell title="Contact Us" titleTextColor="#007AFF" onPress={() => console.log('open Contact Us')}/>
{null}
</index_1.Section>
</index_1.TableView>)
.toJSON();
expect(tree).toMatchSnapshot();
});
it('renders with appearance auto', () => {
const tree = react_test_renderer_1.default
.create(<index_1.TableView appearance="auto">
<index_1.Section footer="All rights reserved.">
<index_1.Cell title="Help / FAQ" titleTextColor="#007AFF" onPress={() => console.log('open Help/FAQ')}/>
<index_1.Cell title="Contact Us" titleTextColor="#007AFF" onPress={() => console.log('open Contact Us')}/>
{null}
</index_1.Section>
</index_1.TableView>)
.toJSON();
expect(tree).toMatchSnapshot();
});
it('renders with appearance light', () => {
const tree = react_test_renderer_1.default
.create(<index_1.TableView appearance="light">
<index_1.Section footer="All rights reserved.">
<index_1.Cell title="Help / FAQ" titleTextColor="#007AFF" onPress={() => console.log('open Help/FAQ')}/>
<index_1.Cell title="Contact Us" titleTextColor="#007AFF" onPress={() => console.log('open Contact Us')}/>
{null}
</index_1.Section>
</index_1.TableView>)
.toJSON();
expect(tree).toMatchSnapshot();
});
it('renders with appearance dark', () => {
const tree = react_test_renderer_1.default
.create(<index_1.TableView appearance="dark">
<index_1.Section footer="All rights reserved.">
<index_1.Cell title="Help / FAQ" titleTextColor="#007AFF" onPress={() => console.log('open Help/FAQ')}/>
<index_1.Cell title="Contact Us" titleTextColor="#007AFF" onPress={() => console.log('open Contact Us')}/>
{null}
</index_1.Section>
</index_1.TableView>)
.toJSON();
expect(tree).toMatchSnapshot();
});
//# sourceMappingURL=TableView.test.js.map