mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-18 11:18:14 +08:00
4e8ba65828
just to get myself into the contributor list
32 lines
888 B
JavaScript
32 lines
888 B
JavaScript
import React from 'react';
|
|
import TestUtils from 'react-addons-test-utils';
|
|
import Button from '../components/button/button';
|
|
|
|
describe('Button', function() {
|
|
let button;
|
|
let buttonNode;
|
|
|
|
beforeEach(() => {
|
|
button = TestUtils.renderIntoDocument(
|
|
<Button>Follow</Button>
|
|
);
|
|
buttonNode = TestUtils.findRenderedDOMComponentWithTag(button, 'button');
|
|
});
|
|
|
|
it('should set the type to button by default', () => {
|
|
expect(buttonNode.type).toBe('button');
|
|
});
|
|
|
|
it('should set the default className to button', () => {
|
|
expect(buttonNode.className).toBe('ant-btn');
|
|
});
|
|
|
|
it('should has a whitespace in two Chinese characters', () => {
|
|
button = TestUtils.renderIntoDocument(
|
|
<Button>按钮</Button>
|
|
);
|
|
buttonNode = TestUtils.findRenderedDOMComponentWithTag(button, 'button');
|
|
expect(buttonNode.textContent).toBe('按 钮');
|
|
});
|
|
});
|