2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-13 08:32:26 +03:00

Clicking a selected tag toggles dropdown

This commit is contained in:
Steven Harman
2018-07-18 01:15:19 -04:00
parent a0c8efe0e5
commit 76cfd7cad9
2 changed files with 22 additions and 1 deletions
+20
View File
@@ -433,6 +433,26 @@ describe('Select.vue', () => {
})
})
it('should open the dropdown when the selected tag is clicked', (done) => {
const vm = new Vue({
template: '<div><v-select :options="options" :value="value"></v-select></div>',
components: {vSelect},
data: {
value: [{label: 'one'}],
options: [{label: 'one'}]
}
}).$mount()
const selectedTag = vm.$children[0].$el.getElementsByClassName('selected-tag')[0]
vm.$children[0].toggleDropdown({target: selectedTag})
Vue.nextTick(() => {
Vue.nextTick(() => {
expect(vm.$children[0].open).toEqual(true)
done()
})
})
})
it('can close the dropdown when the el is clicked', (done) => {
const vm = new Vue({
template: '<div><v-select></v-select></div>',