2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-16 09:10:33 +03:00

Add option to disable the entire component

This commit is contained in:
es
2016-12-26 17:12:56 +08:00
parent bafc873c8f
commit 669984718d
2 changed files with 39 additions and 5 deletions
+20 -1
View File
@@ -253,6 +253,25 @@ describe('Select.vue', () => {
})
describe('Toggling Dropdown', () => {
it('should not open the dropdown when the el is clicked but the component is disabled', (done) => {
const vm = new Vue({
template: '<div><v-select :options="options" :value.sync="value" disabled></v-select></div>',
components: {vSelect},
data: {
value: [{label: 'one'}],
options: [{label: 'one'}]
}
}).$mount()
vm.$children[0].toggleDropdown({target: vm.$children[0].$els.search})
Vue.nextTick(() => {
Vue.nextTick(() => {
expect(vm.$children[0].open).toEqual(false)
done()
})
})
})
it('should open the dropdown when the el is clicked', (done) => {
const vm = new Vue({
template: '<div><v-select :options="options" :value.sync="value"></v-select></div>',
@@ -896,4 +915,4 @@ describe('Select.vue', () => {
})
})
})
})
})