mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 02:31:21 +00:00
component unit test
This commit is contained in:
20
test/unit/specs/card.spec.js
Normal file
20
test/unit/specs/card.spec.js
Normal 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;
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user