Skip to content

Commit b17fce0

Browse files
author
Jeff
committed
test fixes
1 parent 317d8a3 commit b17fce0

File tree

3 files changed

+4
-17
lines changed

3 files changed

+4
-17
lines changed

tests/unit/Layout.spec.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,6 @@ describe("Single value options", () => {
1313
expect(Select.vm.search).toEqual("");
1414
});
1515

16-
it('should apply the "hidden" class to the search input when a value is present', () => {
17-
const Select = shallowMount(VueSelect, { propsData: { value: "foo" } });
18-
expect(Select.vm.inputClasses.hidden).toEqual(true);
19-
});
20-
21-
it('should not apply the "hidden" class to the search input when a value is present, and the dropdown is open', () => {
22-
const Select = shallowMount(VueSelect, { propsData: { value: "foo" } });
23-
Select.vm.toggleDropdown({ target: Select.vm.$refs.search });
24-
25-
expect(Select.vm.open).toEqual(true);
26-
expect(Select.vm.inputClasses.hidden).toEqual(false);
27-
});
28-
2916
it("should not reset the search input on focus lost when clearSearchOnSelect is false", () => {
3017
const Select = shallowMount(VueSelect, {
3118
propsData: { value: "foo", clearSearchOnSelect: false }

tests/unit/ObjectIndex.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ describe("When index prop is defined", () => {
122122
expect(Select.vm.value).toEqual("foo");
123123
expect(Select.vm.mutableValue).toEqual("foo");
124124

125-
Select.vm.mutableValue = "bar";
125+
Select.vm.select({ label: "This is Bar", value: "bar" });
126126
expect(Parent.vm.value).toEqual("bar");
127127
});
128128

tests/unit/Selecting.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { mount, shallowMount } from "@vue/test-utils";
2-
import VueSelect from "@/components/Select.vue";
2+
import VueSelect from "../../src/components/Select.vue";
33

44
describe("VS - Selecting Values", () => {
55
let defaultProps;
@@ -202,15 +202,15 @@ describe("VS - Selecting Values", () => {
202202
describe("change Event", () => {
203203
it("will trigger the input event when the selection changes", () => {
204204
const Select = shallowMount(VueSelect);
205-
Select.vm.$data.mutableValue = "bar";
205+
Select.vm.select("bar");
206206
expect(Select.emitted("input")[0]).toEqual(["bar"]);
207207
});
208208

209209
it("should run change when multiple is true and the value changes", () => {
210210
const Select = shallowMount(VueSelect, {
211211
propsData: { multiple: true, value: ["foo"], options: ["foo", "bar"] }
212212
});
213-
Select.vm.$data.mutableValue = ["bar"];
213+
Select.vm.select("bar");
214214
expect(Select.emitted("input")[0]).toEqual([["bar"]]);
215215
});
216216
});

0 commit comments

Comments
 (0)