Skip to content

Commit 9b444e8

Browse files
authored
local-search test
1 parent e40debe commit 9b444e8

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/unit/specs/Multiselect.spec.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1903,6 +1903,22 @@ describe('Multiselect.vue', () => {
19031903
expect(vm.$children[0].filteredOptions).to.deep.equal([{ isTag: true, label: '1' }, 10])
19041904
expect(vm.$children[0].filteredOptions.length).to.equal(2)
19051905
})
1906+
1907+
it('should not alter the available options when :local-search is FALSE', () => {
1908+
const vm = new Vue({
1909+
template: '<multiselect :selected="value" :options="source" :multiple="true" :local-search="false"></multiselect>',
1910+
components: { Multiselect },
1911+
data: {
1912+
value: [],
1913+
source: [10, 20, 30]
1914+
}
1915+
}).$mount()
1916+
expect(vm.$children[0].filteredOptions).to.deep.equal([10, 20, 30])
1917+
expect(vm.$children[0].filteredOptions.length).to.equal(3)
1918+
vm.$children[0].search = 'test'
1919+
expect(vm.$children[0].filteredOptions).to.deep.equal([10, 20, 30])
1920+
expect(vm.$children[0].filteredOptions.length).to.equal(3)
1921+
})
19061922
})
19071923

19081924
describe('#onTag', () => {

0 commit comments

Comments
 (0)