tests: Add button tests

This commit is contained in:
Wei Zhu 2016-12-14 15:44:38 +08:00
parent 666e80a1ba
commit 587b874fc8
4 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,3 @@
import demoTest from '../../../tests/shared/demoTest';
demoTest('button');

View 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();
});
});