2016-06-22 14:32:42 +08:00
|
|
|
import test from 'ava';
|
2015-11-30 16:54:39 +08:00
|
|
|
import React from 'react';
|
2016-06-22 14:32:42 +08:00
|
|
|
import { shallow } from 'enzyme';
|
2016-06-22 18:10:31 +08:00
|
|
|
import Icon from '../components/icon/index.tsx';
|
2015-11-30 16:54:39 +08:00
|
|
|
|
2016-06-22 14:32:42 +08:00
|
|
|
let iconNode;
|
2015-11-30 16:54:39 +08:00
|
|
|
|
2016-06-22 14:32:42 +08:00
|
|
|
test.beforeEach(() => {
|
|
|
|
iconNode = shallow(
|
|
|
|
<Icon type="appstore" className="my-icon-classname" />
|
|
|
|
);
|
|
|
|
});
|
2015-11-30 16:54:39 +08:00
|
|
|
|
2016-06-22 14:32:42 +08:00
|
|
|
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'));
|
2015-11-30 16:54:39 +08:00
|
|
|
});
|