mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-12 07:09:55 +08:00
f5d697988a
* Fix Tooltip won't hide at disabled button close react-component/tooltip#18 * change button text in test case * Add comments for display attribute * correct test case
29 lines
723 B
JavaScript
29 lines
723 B
JavaScript
import React from 'react';
|
|
import { render, mount } from 'enzyme';
|
|
import { renderToJson } from 'enzyme-to-json';
|
|
import Button from '..';
|
|
|
|
describe('Button', () => {
|
|
it('renders correctly', () => {
|
|
const wrapper = render(
|
|
<Button>Follow</Button>
|
|
);
|
|
expect(renderToJson(wrapper)).toMatchSnapshot();
|
|
});
|
|
|
|
it('renders Chinese characters correctly', () => {
|
|
const wrapper = render(
|
|
<Button>按钮</Button>
|
|
);
|
|
expect(renderToJson(wrapper)).toMatchSnapshot();
|
|
});
|
|
|
|
it('have static perperty for type detecting', () => {
|
|
const wrapper = mount(
|
|
<Button>Button Text</Button>
|
|
);
|
|
// eslint-disable-next-line
|
|
expect(wrapper.type().__ANT_BUTTON).toBe(true);
|
|
});
|
|
});
|