You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
887 B

9 years ago
import React from 'react';
import TestUtils from 'react-addons-test-utils';
import Button from '../components/button/button';
9 years ago
describe('Button', function() {
let button;
let buttonNode;
9 years ago
beforeEach(() => {
button = TestUtils.renderIntoDocument(
<Button>Follow</Button>
);
buttonNode = TestUtils.findRenderedDOMComponentWithTag(button, 'button');
});
9 years ago
it('should set the type to button by default', () => {
expect(buttonNode.type).toBe('button');
});
9 years ago
it('should set the default className to button', () => {
expect(buttonNode.className).toBe('ant-btn');
});
it('should has a whitespace in two Chinese charactor', () => {
button = TestUtils.renderIntoDocument(
<Button>按钮</Button>
);
buttonNode = TestUtils.findRenderedDOMComponentWithTag(button, 'button');
expect(buttonNode.textContent).toBe('按 钮');
});
9 years ago
});