2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-07 07:12:23 +03:00

improving name for should-dropdown-close option. adding test

This commit is contained in:
Kori Roys
2017-04-01 12:07:19 +02:00
parent 897b0d8fb2
commit ecd76ce4dd
3 changed files with 29 additions and 13 deletions
+22 -2
View File
@@ -351,9 +351,10 @@ describe('Select.vue', () => {
})
})
it('can close the dropdown when the el is clicked, multiple is true, and multipleCloseOnSelect option is true', (done) => {
it('closes the dropdown when an option is selected, multiple is true, and closeOnSelect option is true', (done) => {
const vm = new Vue({
template: '<div><v-select ref="select" :options="options" multiple closeOnMultiSelect :value="value"></v-select></div>',
template: '<div><v-select ref="select" :options="options" multiple :value="value"></v-select></div>',
components: {vSelect},
data: {
value: [],
@@ -370,6 +371,25 @@ describe('Select.vue', () => {
})
})
it('does not close the dropdown when the el is clicked, multiple is true, and closeOnSelect option is false', (done) => {
const vm = new Vue({
template: '<div><v-select ref="select" :options="options" multiple :closeOnSelect="false" :value="value"></v-select></div>',
components: {vSelect},
data: {
value: [],
options: ['one', 'two', 'three']
}
}).$mount()
vm.$children[0].open = true
vm.$refs.select.select('one')
Vue.nextTick(() => {
expect(vm.$children[0].open).toEqual(true)
done()
})
})
it('should close the dropdown on search blur', () => {
const vm = new Vue({