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

feat: Vue 3 Support (#1344)

BREAKING CHANGE: drop vue 2 support
This commit is contained in:
Jeff Sagal
2021-10-19 18:53:22 -07:00
committed by GitHub
parent e8d7abbf33
commit 06177a4d24
29 changed files with 774 additions and 561 deletions
+8 -10
View File
@@ -7,12 +7,11 @@ describe('Selectable prop', () => {
selectable: (option) => option === 'one',
})
Select.vm.$data.open = true
Select.vm.open = true
await Select.vm.$nextTick()
Select.find('.vs__dropdown-menu li:first-child').trigger('click')
await Select.find('.vs__dropdown-menu li:first-child').trigger('click')
await Select.vm.$nextTick()
expect(Select.vm.selectedValue).toEqual(['one'])
})
@@ -22,16 +21,15 @@ describe('Selectable prop', () => {
selectable: (option) => option === 'one',
})
Select.vm.$data.open = true
Select.vm.open = true
await Select.vm.$nextTick()
Select.find('.vs__dropdown-menu li:last-child').trigger('click')
await Select.vm.$nextTick()
await Select.find('.vs__dropdown-menu li:last-child').trigger('click')
expect(Select.vm.selectedValue).toEqual([])
})
it('should skip non-selectable option on down arrow keyDown', () => {
it('should skip non-selectable option on down arrow keyDown', async () => {
const Select = selectWithProps({
options: ['one', 'two', 'three'],
selectable: (option) => option !== 'two',
@@ -39,12 +37,12 @@ describe('Selectable prop', () => {
Select.vm.typeAheadPointer = 1
Select.findComponent({ ref: 'search' }).trigger('keydown.down')
await Select.get('input').trigger('keydown.down')
expect(Select.vm.typeAheadPointer).toEqual(2)
})
it('should skip non-selectable option on up arrow keyDown', () => {
it('should skip non-selectable option on up arrow keyDown', async () => {
const Select = selectWithProps({
options: ['one', 'two', 'three'],
selectable: (option) => option !== 'two',
@@ -52,7 +50,7 @@ describe('Selectable prop', () => {
Select.vm.typeAheadPointer = 2
Select.findComponent({ ref: 'search' }).trigger('keydown.up')
await Select.get('input').trigger('keydown.up')
expect(Select.vm.typeAheadPointer).toEqual(0)
})