// @ts-ignore import { configure, shallow } from 'enzyme'; // @ts-ignore import Adapter from 'enzyme-adapter-react-16'; import * as React from 'react'; import { Text } from 'react-native'; import renderer from 'react-test-renderer'; import MDTabBar, { MDTabBarStyles } from '../index'; const styles = Object.assign({}, MDTabBarStyles, { wrapper: { position: 'relative', backgroundColor: '#ddd', }, }); configure({ adapter: new Adapter() }); const items = [{ name: 0, label: '标签1' }, { name: 1, label: '标签2' }]; it('renders correctly with defaults', () => { const component = renderer.create().toJSON(); expect(component).toMatchSnapshot(); }); it('renders correctly with hasInk', () => { const component = renderer.create().toJSON(); expect(component).toMatchSnapshot(); }); it('renders correctly with current', () => { const component = renderer.create().toJSON(); expect(component).toMatchSnapshot(); }); it('renders correctly with items', () => { const component = renderer.create().toJSON(); expect(component).toMatchSnapshot(); }); it('renders correctly with custom', () => { const component = renderer .create( test ) .toJSON(); expect(component).toMatchSnapshot(); }); it('renders correctly with empty style', () => { // @ts-ignore const component = renderer.create().toJSON(); expect(component).toMatchSnapshot(); }); it('renders correctly with custom style', () => { const component = renderer.create().toJSON(); expect(component).toMatchSnapshot(); }); it('renders correctly with event', () => { const component = renderer .create( { console.log('value'); }} /> ) .toJSON(); expect(component).toMatchSnapshot(); });