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

add test and example for filtering arrays of numbers

This commit is contained in:
Jeff
2018-01-12 23:22:24 -08:00
parent 2cffee27f6
commit 56394e6850
2 changed files with 13 additions and 0 deletions
+12
View File
@@ -350,6 +350,18 @@ describe('Select.vue', () => {
vm.$refs.select.search = 'a'
expect(JSON.stringify(vm.$refs.select.filteredOptions)).toEqual(JSON.stringify(['bar','baz']))
})
it('can filter arrays of numbers', () => {
const vm = new Vue({
template: `<div><v-select ref="select" :options="options"></v-select></div>`,
data: {
options: [1,5,10],
value: 'foo'
},
}).$mount()
vm.$refs.select.search = '5'
expect(JSON.stringify(vm.$refs.select.filteredOptions)).toEqual(JSON.stringify([5]))
})
})
describe('Toggling Dropdown', () => {