mirror of
https://github.com/tenrok/vue-select.git
synced 2026-06-22 10:30:34 +03:00
add test and example for filtering arrays of numbers
This commit is contained in:
@@ -31,6 +31,7 @@
|
|||||||
<div id="app">
|
<div id="app">
|
||||||
<v-select placeholder="default" :options="options"></v-select>
|
<v-select placeholder="default" :options="options"></v-select>
|
||||||
<v-select placeholder="default, RTL" :options="options" dir="rtl"></v-select>
|
<v-select placeholder="default, RTL" :options="options" dir="rtl"></v-select>
|
||||||
|
<v-select placeholder="default, options=[1,5,10]" :options="[1,5,10]"></v-select>
|
||||||
<v-select placeholder="multiple" multiple :options="options"></v-select>
|
<v-select placeholder="multiple" multiple :options="options"></v-select>
|
||||||
<v-select placeholder="multiple, taggable" multiple taggable :options="options" no-drop></v-select>
|
<v-select placeholder="multiple, taggable" multiple taggable :options="options" no-drop></v-select>
|
||||||
<v-select placeholder="multiple, taggable, push-tags" multiple push-tags taggable :options="[{label: 'Foo', value: 'foo'}]"></v-select>
|
<v-select placeholder="multiple, taggable, push-tags" multiple push-tags taggable :options="[{label: 'Foo', value: 'foo'}]"></v-select>
|
||||||
|
|||||||
@@ -350,6 +350,18 @@ describe('Select.vue', () => {
|
|||||||
vm.$refs.select.search = 'a'
|
vm.$refs.select.search = 'a'
|
||||||
expect(JSON.stringify(vm.$refs.select.filteredOptions)).toEqual(JSON.stringify(['bar','baz']))
|
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', () => {
|
describe('Toggling Dropdown', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user