2015-11-03 11:56:08 +08:00
|
|
|
import React from 'react';
|
2016-11-14 18:31:08 +08:00
|
|
|
import { render } from 'enzyme';
|
|
|
|
import { renderToJson } from 'enzyme-to-json';
|
2016-11-22 13:43:53 +08:00
|
|
|
import Button from '../../components/button';
|
2015-11-03 11:56:08 +08:00
|
|
|
|
2016-06-22 22:31:00 +08:00
|
|
|
describe('Button', function() {
|
2016-11-14 18:31:08 +08:00
|
|
|
it('renders correctly', () => {
|
|
|
|
const wrapper = render(
|
2016-06-22 22:31:00 +08:00
|
|
|
<Button>Follow</Button>
|
|
|
|
);
|
2016-11-14 18:31:08 +08:00
|
|
|
expect(renderToJson(wrapper)).toMatchSnapshot();
|
2016-06-22 22:31:00 +08:00
|
|
|
});
|
2015-12-06 16:43:48 +08:00
|
|
|
|
2016-11-14 18:31:08 +08:00
|
|
|
it('renders Chinese characters correctly', () => {
|
|
|
|
const wrapper = render(
|
2016-06-22 22:31:00 +08:00
|
|
|
<Button>按钮</Button>
|
|
|
|
);
|
2016-11-14 18:31:08 +08:00
|
|
|
expect(renderToJson(wrapper)).toMatchSnapshot();
|
2016-06-22 22:31:00 +08:00
|
|
|
});
|
2015-11-03 11:56:08 +08:00
|
|
|
});
|