2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-10 07:52:23 +03:00

test fixes

This commit is contained in:
Jeff
2019-02-10 16:43:19 -08:00
parent 317d8a30b8
commit b17fce0ad8
3 changed files with 4 additions and 17 deletions
-13
View File
@@ -13,19 +13,6 @@ describe("Single value options", () => {
expect(Select.vm.search).toEqual("");
});
it('should apply the "hidden" class to the search input when a value is present', () => {
const Select = shallowMount(VueSelect, { propsData: { value: "foo" } });
expect(Select.vm.inputClasses.hidden).toEqual(true);
});
it('should not apply the "hidden" class to the search input when a value is present, and the dropdown is open', () => {
const Select = shallowMount(VueSelect, { propsData: { value: "foo" } });
Select.vm.toggleDropdown({ target: Select.vm.$refs.search });
expect(Select.vm.open).toEqual(true);
expect(Select.vm.inputClasses.hidden).toEqual(false);
});
it("should not reset the search input on focus lost when clearSearchOnSelect is false", () => {
const Select = shallowMount(VueSelect, {
propsData: { value: "foo", clearSearchOnSelect: false }
+1 -1
View File
@@ -122,7 +122,7 @@ describe("When index prop is defined", () => {
expect(Select.vm.value).toEqual("foo");
expect(Select.vm.mutableValue).toEqual("foo");
Select.vm.mutableValue = "bar";
Select.vm.select({ label: "This is Bar", value: "bar" });
expect(Parent.vm.value).toEqual("bar");
});
+3 -3
View File
@@ -1,5 +1,5 @@
import { mount, shallowMount } from "@vue/test-utils";
import VueSelect from "@/components/Select.vue";
import VueSelect from "../../src/components/Select.vue";
describe("VS - Selecting Values", () => {
let defaultProps;
@@ -202,7 +202,7 @@ describe("VS - Selecting Values", () => {
describe("change Event", () => {
it("will trigger the input event when the selection changes", () => {
const Select = shallowMount(VueSelect);
Select.vm.$data.mutableValue = "bar";
Select.vm.select("bar");
expect(Select.emitted("input")[0]).toEqual(["bar"]);
});
@@ -210,7 +210,7 @@ describe("VS - Selecting Values", () => {
const Select = shallowMount(VueSelect, {
propsData: { multiple: true, value: ["foo"], options: ["foo", "bar"] }
});
Select.vm.$data.mutableValue = ["bar"];
Select.vm.select("bar");
expect(Select.emitted("input")[0]).toEqual([["bar"]]);
});
});