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

Prevent removal of items when disabled

This commit is contained in:
Andrew
2017-10-20 21:18:57 +11:00
parent f836eaeb6a
commit d6b822771b
3 changed files with 40 additions and 18 deletions
+16
View File
@@ -693,6 +693,22 @@ describe('Select.vue', () => {
})
})
it('should not remove tag when close icon is clicked and component is disabled', (done) => {
const vm = new Vue({
template: '<div><v-select disabled multiple :options="options" v-model="value"></v-select></div>',
components: {vSelect},
data: {
value: ['one'],
options: ['one', 'two', 'three']
}
}).$mount()
vm.$children[0].$refs.toggle.querySelector('.close').click()
Vue.nextTick(() => {
expect(vm.$children[0].mutableValue).toEqual(['one'])
done()
})
})
it('should remove the last item in the value array on delete keypress when multiple is true', () => {
const vm = new Vue({