mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-30 06:09:34 +08:00
28 lines
775 B
JavaScript
28 lines
775 B
JavaScript
jest.dontMock('../components/icon/index');
|
|
|
|
import React from 'react';
|
|
import TestUtils from 'react-addons-test-utils';
|
|
import { wrap } from 'react-stateless-wrapper';
|
|
|
|
const Icon = wrap(require('../components/icon/index'));
|
|
|
|
describe('Icon', function() {
|
|
let icon;
|
|
let iconNode;
|
|
|
|
beforeEach(() => {
|
|
icon = TestUtils.renderIntoDocument(
|
|
<Icon type="appstore" className="my-icon-classname" />
|
|
);
|
|
iconNode = TestUtils.findRenderedDOMComponentWithTag(icon, 'I');
|
|
});
|
|
|
|
it('should render to a <i class="xxx"></i>', () => {
|
|
expect(iconNode.tagName).toBe('I');
|
|
expect(iconNode.className).toContain('my-icon-classname');
|
|
expect(iconNode.className).toContain('anticon');
|
|
expect(iconNode.className).toContain('anticon-appstore');
|
|
});
|
|
});
|
|
|