mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-26 04:00:13 +08:00
0ca6a1c24a
* css modularize * Add alert style * Move more component style * Move iconfont to common style * Move layout style * Move more component style * Move all components * Fix lots of mixin deps * remove css-prefix from less * fix a button icon style bug * restructure * fix index * add dist * fix jest * fix some components style * clean webpack config * check more components style * update tabs * update scripts * update scripts * fix form style * fix more style * Fix select width * Fix form and tabs style
35 lines
973 B
JavaScript
35 lines
973 B
JavaScript
jest.unmock('../components/button/button');
|
|
jest.unmock('../components/icon/index');
|
|
|
|
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 charactor', () => {
|
|
button = TestUtils.renderIntoDocument(
|
|
<Button>按钮</Button>
|
|
);
|
|
buttonNode = TestUtils.findRenderedDOMComponentWithTag(button, 'button');
|
|
expect(buttonNode.textContent).toBe('按 钮');
|
|
});
|
|
});
|