Fix tests

pull/459/head
afc163 9 years ago
parent caa87cb6f2
commit c0dc894cbe

@ -73,6 +73,7 @@
"babel": "^5.8.29",
"babel-core": "^5.8.29",
"babel-eslint": "^4.1.0",
"babel-jest": "^5.3.0",
"babel-loader": "^5.3.2",
"busboy": "^0.2.9",
"chalk": "^1.1.0",

@ -0,0 +1,26 @@
jest.dontMock('../components/button/button');
import React from 'react';
import TestUtils from 'react-addons-test-utils';
const Button = require('../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');
});
});

@ -1,4 +1,6 @@
jest.dontMock('../index');
import React from 'react';
import antd, {
Button,
} from '../index';

Loading…
Cancel
Save