ant-design/tests/icon.test.js

20 lines
494 B
JavaScript
Raw Normal View History

import test from 'ava';
import React from 'react';
import { shallow } from 'enzyme';
2016-06-22 18:10:31 +08:00
import Icon from '../components/icon/index.tsx';
let iconNode;
test.beforeEach(() => {
iconNode = shallow(
<Icon type="appstore" className="my-icon-classname" />
);
});
test('should render to a <i class="xxx"></i>', (t) => {
t.is(iconNode.type(), 'i');
t.true(iconNode.hasClass('my-icon-classname'));
t.true(iconNode.hasClass('anticon'));
t.true(iconNode.hasClass('anticon-appstore'));
});