2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-16 09:10:33 +03:00

Merge branch 'stevenharman-flexbox-based-layout'

# Conflicts:
#	src/components/Select.vue
#	test/unit/specs/Select.spec.js
This commit is contained in:
Jeff
2018-08-07 20:50:57 -07:00
2 changed files with 129 additions and 179 deletions
-47
View File
@@ -249,36 +249,6 @@ describe('Select.vue', () => {
expect(vm.$children[0].isOptionSelected('foo')).toEqual(true)
}),
it('applies the "empty" class to the search input when no value is selected', () => {
const vm = new Vue({
template: '<div><v-select :options="options" multiple v-model="value"></v-select></div>',
components: {vSelect},
data: {
value: null,
options: [{label: 'one'}]
}
}).$mount()
expect(vm.$children[0].inputClasses.empty).toEqual(true)
expect(vm.$children[0].inputClasses.shrunk).toEqual(false)
expect(vm.$children[0].inputClasses.hidden).toEqual(false)
}),
it('applies the "shrunk" class to the search input when one or more value is selected', () => {
const vm = new Vue({
template: '<div><v-select :options="options" multiple v-model="value"></v-select></div>',
components: {vSelect},
data: {
value: [{label: 'one'}],
options: [{label: 'one'}]
}
}).$mount()
expect(vm.$children[0].inputClasses.shrunk).toEqual(true)
expect(vm.$children[0].inputClasses.empty).toEqual(false)
expect(vm.$children[0].inputClasses.hidden).toEqual(false)
}),
describe('change Event', () => {
it('will trigger the input event when the selection changes', (done) => {
const vm = new Vue({
@@ -1585,19 +1555,6 @@ describe('Select.vue', () => {
})
})
it('should apply the "empty" class to the search input when it does not have a selected value', () => {
const vm = new Vue({
template: '<div><v-select ref="select" :options="options" :value="value"></v-select></div>',
data: {
value: '',
options: ['one', 'two', 'three']
}
}).$mount()
expect(vm.$children[0].inputClasses.empty).toEqual(true)
expect(vm.$children[0].inputClasses.shrunk).toEqual(false)
expect(vm.$children[0].inputClasses.hidden).toEqual(false)
})
it('should apply the "hidden" class to the search input when a value is present', () => {
const vm = new Vue({
template: '<div><v-select ref="select" :options="options" :value="value"></v-select></div>',
@@ -1608,8 +1565,6 @@ describe('Select.vue', () => {
}).$mount()
expect(vm.$children[0].inputClasses.hidden).toEqual(true)
expect(vm.$children[0].inputClasses.empty).toEqual(false)
expect(vm.$children[0].inputClasses.shrunk).toEqual(false)
})
@@ -1627,8 +1582,6 @@ describe('Select.vue', () => {
Vue.nextTick(() => {
expect(vm.$children[0].open).toEqual(true)
expect(vm.$children[0].inputClasses.hidden).toEqual(false)
expect(vm.$children[0].inputClasses.empty).toEqual(false)
expect(vm.$children[0].inputClasses.shrunk).toEqual(false)
done()
})
})