unit test

This commit is contained in:
cookfront
2017-04-12 15:01:45 +08:00
parent 7c75f48eaa
commit 5c389968f7
4 changed files with 100 additions and 2 deletions

View File

@@ -0,0 +1,25 @@
import Badge from 'packages/badge';
import BadgeGroup from 'packages/badge-group';
import { mount } from 'avoriaz';
describe('Badge', () => {
let wrapper;
afterEach(() => {
wrapper && wrapper.destroy();
});
});
describe('BadgeGroup', () => {
let wrapper;
afterEach(() => {
wrapper && wrapper.destroy();
});
it('create a badge-group', () => {
wrapper = mount(BadgeGroup);
expect(wrapper.hasClass('zan-badge-group')).to.be.true;
expect(wrapper.instance().activeKey).to.equal(0);
expect(wrapper.data().badges.length).to.equal(0);
});
});