2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-22 10:30:34 +03:00

complete dropdown toggle tests

This commit is contained in:
Jeff Sagal
2016-05-29 20:44:42 -07:00
parent 1607c6eddb
commit f682f03946
+32 -36
View File
@@ -232,24 +232,22 @@ describe('Select.vue', () => {
}) })
}) })
// it('can close the dropdown when the el is clicked', (done) => { it('can close the dropdown when the el is clicked', (done) => {
// const vm = new Vue({ const vm = new Vue({
// template: '<div><v-select :options="options" :value.sync="value"></v-select></div>', template: '<div><v-select></v-select></div>',
// components: {vSelect}, components: {vSelect},
// data: { }).$mount()
// value: [{label: 'one'}],
// options: [{label: 'one'}] spyOn(vm.$children[0].$els.search, 'blur')
// }
// }).$mount() vm.$children[0].open = true
// vm.$children[0].open = true vm.$children[0].toggleDropdown({target: vm.$children[0].$el})
// Vue.nextTick(() => {
// vm.$children[0].toggleDropdown({ target: vm.$children[0].$el }) Vue.nextTick(() => {
// Vue.nextTick( () => { expect(vm.$children[0].$els.search.blur).toHaveBeenCalled()
// expect(vm.$children[0].open).toEqual(false) done()
// done() })
// }) })
// })
// })
it('should close the dropdown on search blur', () => { it('should close the dropdown on search blur', () => {
const vm = new Vue({ const vm = new Vue({
@@ -266,24 +264,22 @@ describe('Select.vue', () => {
expect(vm.$children[0].open).toEqual(true) expect(vm.$children[0].open).toEqual(true)
}) })
// it('will close the dropdown on escape, if search is empty', (done) => { it('will close the dropdown on escape, if search is empty', (done) => {
// const vm = new Vue({ const vm = new Vue({
// template: '<div><v-select :options="options" multiple :value.sync="value"></v-select></div>', template: '<div><v-select></v-select></div>',
// components: {vSelect}, components: {vSelect},
// data: { }).$mount()
// value: [{label: 'one'}],
// options: [{label: 'one'}] spyOn(vm.$children[0].$els.search, 'blur')
// }
// }).$mount() vm.$children[0].open = true
// vm.$children[0].open = true vm.$children[0].onEscape()
// vm.$children[0].onEscape()
// Vue.nextTick(() => { Vue.nextTick(() => {
// Vue.nextTick(() => { expect(vm.$children[0].$els.search.blur).toHaveBeenCalled()
// expect(vm.$children[0].open).toEqual(false) done()
// done() })
// }) })
// })
// })
it('should remove existing search text on escape keyup', () => { it('should remove existing search text on escape keyup', () => {
const vm = new Vue({ const vm = new Vue({