mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
badge unit test
This commit is contained in:
parent
0e9597d218
commit
6c27dd5e61
@ -1,7 +1,15 @@
|
||||
// import Badge from 'packages/badge';
|
||||
import Vue from 'vue';
|
||||
import Badge from 'packages/badge';
|
||||
import BadgeGroup from 'packages/badge-group';
|
||||
import { mount } from 'avoriaz';
|
||||
|
||||
Vue.component(Badge.name, Badge);
|
||||
Vue.component(BadgeGroup.name, BadgeGroup);
|
||||
|
||||
const component = Vue.component({
|
||||
|
||||
});
|
||||
|
||||
describe('BadgeGroup', () => {
|
||||
let wrapper;
|
||||
afterEach(() => {
|
||||
@ -16,3 +24,20 @@ describe('BadgeGroup', () => {
|
||||
expect(wrapper.data().badges.length).to.equal(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Badge', () => {
|
||||
let wrapper;
|
||||
afterEach(() => {
|
||||
wrapper && wrapper.destroy();
|
||||
});
|
||||
|
||||
it('create a badge', () => {
|
||||
wrapper = mount(Badge, {
|
||||
propsData: {
|
||||
title: 'test'
|
||||
}
|
||||
});
|
||||
|
||||
expect(wrapper.hasClass('zan-badge')).to.be.true;
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user