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

feat: merge upstream into beta channel (#1589)

This commit is contained in:
Jeff Sagal
2022-02-18 13:55:34 -08:00
committed by GitHub
parent 7a3b373d43
commit ff2806876d
40 changed files with 2565 additions and 3146 deletions
+16 -1
View File
@@ -1,4 +1,4 @@
import { selectWithProps } from '../helpers'
import { searchSubmit, selectWithProps } from '../helpers'
describe('Selectable prop', () => {
it('should select selectable option if clicked', async () => {
@@ -54,4 +54,19 @@ describe('Selectable prop', () => {
expect(Select.vm.typeAheadPointer).toEqual(0)
})
it('should not let the user select an unselectable option with return', async () => {
const Select = selectWithProps({
options: ['one', 'two'],
multiple: true,
selectable: (option) => option !== 'two',
})
// this sets the typeAheadPointer to 0
await searchSubmit(Select, 'one')
expect(Select.vm.selectedValue).toEqual(['one'])
await searchSubmit(Select, 'two')
expect(Select.vm.selectedValue).toEqual(['one'])
})
})