mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 22:36:31 +08:00
tests: Add button tests
This commit is contained in:
parent
666e80a1ba
commit
587b874fc8
3
components/button/__tests__/demo.test.js
Normal file
3
components/button/__tests__/demo.test.js
Normal file
@ -0,0 +1,3 @@
|
||||
import demoTest from '../../../tests/shared/demoTest';
|
||||
|
||||
demoTest('button');
|
20
components/button/__tests__/index.test.js
Normal file
20
components/button/__tests__/index.test.js
Normal file
@ -0,0 +1,20 @@
|
||||
import React from 'react';
|
||||
import { render } 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();
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user