test: fix date-picker

pull/7258/head^2
wacky6.AriesMBP 2017-10-12 00:09:57 +11:00 committed by 杨奕
parent 83245f846d
commit 78d97c8e3f
1 changed files with 4 additions and 4 deletions

View File

@ -376,17 +376,17 @@ describe('DatePicker', () => {
ref="compo" ref="compo"
v-model="value" v-model="value"
type="date" type="date"
@change="handleChange"
value-format="dd-MM-yyyy" />`, value-format="dd-MM-yyyy" />`,
data() { data() {
return { return {
value: '', value: ''
handleChange: null
}; };
} }
}, true); }, true);
const spy = sinon.spy(); const spy = sinon.spy();
vm.handleChange = spy; vm.$refs.compo.$on('change', spy);
vm.$refs.compo.$el.querySelector('input').focus(); vm.$refs.compo.$el.querySelector('input').focus();
setTimeout(_ => { setTimeout(_ => {
vm.$refs.compo.picker.$el.querySelector('.el-date-table td.available').click(); vm.$refs.compo.picker.$el.querySelector('.el-date-table td.available').click();