mirror of
https://github.com/tenrok/vue-select.git
synced 2026-05-17 02:29:37 +03:00
98c278b2bb
BREAKING: mixins are no longer exported from the index (and will likely be converted to hooks)
32 lines
902 B
JavaScript
Executable File
32 lines
902 B
JavaScript
Executable File
import { it, describe, expect } from 'vitest'
|
|
import { shallowMount } from '@vue/test-utils'
|
|
import VueSelect from '@/components/Select.vue'
|
|
|
|
describe('Single value options', () => {
|
|
it('should reset the search input on focus lost', () => {
|
|
const Select = shallowMount(VueSelect)
|
|
Select.vm.open = true
|
|
|
|
Select.vm.search = 't'
|
|
expect(Select.vm.search).toEqual('t')
|
|
|
|
Select.vm.onSearchBlur()
|
|
expect(Select.vm.search).toEqual('')
|
|
})
|
|
|
|
it('should not reset the search input on focus lost when clearSearchOnSelect is false', () => {
|
|
const Select = shallowMount(VueSelect, {
|
|
props: { value: 'foo', clearSearchOnSelect: false },
|
|
})
|
|
|
|
expect(Select.vm.clearSearchOnSelect).toEqual(false)
|
|
|
|
Select.vm.open = true
|
|
Select.vm.search = 't'
|
|
expect(Select.vm.search).toEqual('t')
|
|
|
|
Select.vm.onSearchBlur()
|
|
expect(Select.vm.search).toEqual('t')
|
|
})
|
|
})
|