// @ts-ignore
import { configure, mount, 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 MDButton from '../../button/index';
import MDTip from '../index';
configure({ adapter: new Adapter() });
// NativeModules.UIManager.measure 暂时没有找到方法进行UT测试
it('renders correctly with defaults', () => {
const component = renderer.create(
).toJSON();
expect(component).toMatchSnapshot();
});
it('renders correctly with custom icon', () => {
const component = renderer.create().toJSON();
expect(component).toMatchSnapshot();
});
it('renders correctly with custom placement', () => {
const component = renderer.create().toJSON();
expect(component).toMatchSnapshot();
});
it('renders correctly with press event', () => {
const component = shallow(
点击我
);
const instance = component.instance();
expect(component.state('visible')).toEqual(false);
component.find('TouchableWithoutFeedback').simulate('press');
});
it('renders correctly with onShow && onHide', () => {
const mockCallBack = jest.fn();
const component = shallow(
点击我
);
});