mirror of
https://github.com/youzan/vant.git
synced 2025-10-17 16:44:21 +00:00
fix bugs and add new features (#25)
* fix bugs and add new features * add unit test * fix tab/tag/datetime-picker bugs
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<van-tabs :active="active" @click="handleTabClick" @disabled="handleTabDisabledClick">
|
||||
<van-tabs :active="active" :duration="duration" @click="handleTabClick" @disabled="handleTabDisabledClick">
|
||||
<van-tab title="选项一">内容一</van-tab>
|
||||
<van-tab title="选项二">内容二</van-tab>
|
||||
<van-tab title="选项三" disabled>内容三</van-tab>
|
||||
@@ -20,7 +20,8 @@ export default {
|
||||
|
||||
data() {
|
||||
return {
|
||||
active: 0
|
||||
active: 0,
|
||||
duration: 0.5
|
||||
};
|
||||
},
|
||||
|
||||
|
@@ -68,4 +68,10 @@ describe('Tabs', () => {
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('check animation duration', () => {
|
||||
wrapper = mount(TabsTestComponent);
|
||||
|
||||
expect(wrapper.style.transitionDuration != '').to.be.true;
|
||||
});
|
||||
});
|
||||
|
29
test/unit/specs/tag.spec.js
Normal file
29
test/unit/specs/tag.spec.js
Normal file
@@ -0,0 +1,29 @@
|
||||
import Tag from 'packages/tag';
|
||||
import { mount } from 'avoriaz';
|
||||
|
||||
describe('Tag', () => {
|
||||
let wrapper;
|
||||
afterEach(() => {
|
||||
wrapper && wrapper.destroy();
|
||||
});
|
||||
|
||||
it('create without typeProps', () => {
|
||||
wrapper = mount(Tag);
|
||||
});
|
||||
|
||||
it('create with right typeProps', () => {
|
||||
wrapper = mount(Tag, {
|
||||
propsData: {
|
||||
type: 'primary'
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
it('create with wrong typeProps', () => {
|
||||
wrapper = mount(Tag, {
|
||||
propsData: {
|
||||
type: 'wrong'
|
||||
}
|
||||
})
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user