mirror of
https://github.com/tenrok/vue-select.git
synced 2026-06-19 09:50:33 +03:00
Complete Layout specs
This commit is contained in:
+27
-54
@@ -13,58 +13,31 @@ describe("Single value options", () => {
|
|||||||
expect(Select.vm.search).toEqual("");
|
expect(Select.vm.search).toEqual("");
|
||||||
});
|
});
|
||||||
|
|
||||||
// it('should apply the "hidden" class to the search input when a value is present', () => {
|
it('should apply the "hidden" class to the search input when a value is present', () => {
|
||||||
// const vm = new Vue({
|
const Select = shallowMount(VueSelect, { propsData: { value: "foo" } });
|
||||||
// template:
|
expect(Select.vm.inputClasses.hidden).toEqual(true);
|
||||||
// '<div><v-select ref="select" :options="options" :value="value"></v-select></div>',
|
});
|
||||||
// data: {
|
|
||||||
// value: "one",
|
it('should not apply the "hidden" class to the search input when a value is present, and the dropdown is open', () => {
|
||||||
// options: ["one", "two", "three"]
|
const Select = shallowMount(VueSelect, { propsData: { value: "foo" } });
|
||||||
// }
|
Select.vm.toggleDropdown({ target: Select.vm.$refs.search });
|
||||||
// }).$mount();
|
|
||||||
//
|
expect(Select.vm.open).toEqual(true);
|
||||||
// expect(vm.$children[0].inputClasses.hidden).toEqual(true);
|
expect(Select.vm.inputClasses.hidden).toEqual(false);
|
||||||
// });
|
});
|
||||||
//
|
|
||||||
// it('should not apply the "hidden" class to the search input when a value is present, and the dropdown is open', done => {
|
it("should not reset the search input on focus lost when clearSearchOnSelect is false", () => {
|
||||||
// const vm = new Vue({
|
const Select = shallowMount(VueSelect, {
|
||||||
// template:
|
propsData: { value: "foo", clearSearchOnSelect: false }
|
||||||
// '<div><v-select ref="select" :options="options" :value="value"></v-select></div>',
|
});
|
||||||
// data: {
|
|
||||||
// value: "one",
|
expect(Select.vm.clearSearchOnSelect).toEqual(false);
|
||||||
// options: ["one", "two", "three"],
|
|
||||||
// open: true
|
Select.vm.open = true;
|
||||||
// }
|
Select.vm.search = "t";
|
||||||
// }).$mount();
|
expect(Select.vm.search).toEqual("t");
|
||||||
// vm.$children[0].toggleDropdown({ target: vm.$children[0].$refs.search });
|
|
||||||
// Vue.nextTick(() => {
|
Select.vm.onSearchBlur();
|
||||||
// Vue.nextTick(() => {
|
expect(Select.vm.search).toEqual("t");
|
||||||
// expect(vm.$children[0].open).toEqual(true);
|
});
|
||||||
// expect(vm.$children[0].inputClasses.hidden).toEqual(false);
|
|
||||||
// done();
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// it("should not reset the search input on focus lost when clearSearchOnSelect is false", done => {
|
|
||||||
// const vm = new Vue({
|
|
||||||
// template:
|
|
||||||
// '<div><v-select ref="select" :options="options" :value="value" :clear-search-on-select="false"></v-select></div>',
|
|
||||||
// data: {
|
|
||||||
// value: "one",
|
|
||||||
// options: ["one", "two", "three"]
|
|
||||||
// }
|
|
||||||
// }).$mount();
|
|
||||||
// expect(vm.$refs.select.clearSearchOnSelect).toEqual(false);
|
|
||||||
//
|
|
||||||
// vm.$children[0].open = true;
|
|
||||||
// vm.$refs.select.search = "t";
|
|
||||||
// expect(vm.$refs.select.search).toEqual("t");
|
|
||||||
//
|
|
||||||
// vm.$children[0].onSearchBlur();
|
|
||||||
// Vue.nextTick(() => {
|
|
||||||
// expect(vm.$refs.select.search).toEqual("t");
|
|
||||||
// done();
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user