component unit test

This commit is contained in:
cookfront
2017-03-10 16:07:36 +08:00
parent 56fe6b5704
commit 66db79484d
5 changed files with 84 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
import { createVue } from '../creater';
import Card from 'packages/card';
describe('Card', () => {
let vm;
afterEach(() => {
vm && vm.destroy();
});
it('create', () => {
vm = createVue(Card, {
title: 'card',
desc: 'card',
thumb: 'https://img.yzcdn.cn/upload_files/2017/02/17/FnDwvwHmU-OiqsbjAO5X7wh1KWrR.jpg!100x100.jpg'
});
vm.mount();
expect(vm.el.classList.contains('zan-card')).to.true;
});
});