From b17fce0ad8d9ee4a7c1e78420b9a757ed210fff7 Mon Sep 17 00:00:00 2001 From: Jeff Date: Sun, 10 Feb 2019 16:43:19 -0800 Subject: [PATCH] test fixes --- tests/unit/Layout.spec.js | 13 ------------- tests/unit/ObjectIndex.spec.js | 2 +- tests/unit/Selecting.spec.js | 6 +++--- 3 files changed, 4 insertions(+), 17 deletions(-) diff --git a/tests/unit/Layout.spec.js b/tests/unit/Layout.spec.js index 9fb84fb..9acbb0c 100755 --- a/tests/unit/Layout.spec.js +++ b/tests/unit/Layout.spec.js @@ -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 } diff --git a/tests/unit/ObjectIndex.spec.js b/tests/unit/ObjectIndex.spec.js index 530dc1a..919d17c 100755 --- a/tests/unit/ObjectIndex.spec.js +++ b/tests/unit/ObjectIndex.spec.js @@ -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"); }); diff --git a/tests/unit/Selecting.spec.js b/tests/unit/Selecting.spec.js index af49b9f..3e33d99 100755 --- a/tests/unit/Selecting.spec.js +++ b/tests/unit/Selecting.spec.js @@ -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"]]); }); });