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:
@@ -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'])
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user