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:
TimeTraveler
2017-05-03 10:11:31 +08:00
committed by 张敏
parent 58bd17f142
commit 239d2e1e53
31 changed files with 134 additions and 27 deletions

View File

@@ -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
};
},

View File

@@ -68,4 +68,10 @@ describe('Tabs', () => {
done();
});
});
it('check animation duration', () => {
wrapper = mount(TabsTestComponent);
expect(wrapper.style.transitionDuration != '').to.be.true;
});
});

View 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'
}
})
});
});