mirror of
https://github.com/tenrok/vue-select.git
synced 2026-06-19 09:50:33 +03:00
fix failing test
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
import { shallowMount } from "@vue/test-utils";
|
import { shallowMount } from "@vue/test-utils";
|
||||||
import VueSelect from "../src/components/Select";
|
import VueSelect from "../src/components/Select.vue";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Trigger a submit event on the search
|
* Trigger a submit event on the search
|
||||||
|
|||||||
@@ -174,18 +174,18 @@ describe("VS - Selecting Values", () => {
|
|||||||
expect(Select.vm.isOptionSelected({ label: "one" })).toEqual(true);
|
expect(Select.vm.isOptionSelected({ label: "one" })).toEqual(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("can use v-model syntax for a two way binding to a parent component", () => {
|
it.only("can use v-model syntax for a two way binding to a parent component", () => {
|
||||||
const Parent = mount({
|
const Parent = mount({
|
||||||
data: () => ({ value: "foo", options: ["foo", "bar", "baz"] }),
|
data: () => ({ value: "foo", options: ["foo", "bar", "baz"] }),
|
||||||
template: `<div><v-select :options="options" v-model="value" /></div>`,
|
template: `<div><v-select :options="options" v-model="value" /></div>`,
|
||||||
components: { "v-select": VueSelect }
|
components: { "v-select": VueSelect }
|
||||||
});
|
});
|
||||||
const Select = Parent.find(VueSelect);
|
const Select = Parent.vm.$children[0];
|
||||||
|
|
||||||
expect(Select.vm.value).toEqual("foo");
|
expect(Select.value).toEqual("foo");
|
||||||
expect(Select.vm.mutableValue).toEqual("foo");
|
expect(Select.mutableValue).toEqual("foo");
|
||||||
|
|
||||||
Select.vm.mutableValue = "bar";
|
Select.select("bar");
|
||||||
expect(Parent.vm.value).toEqual("bar");
|
expect(Parent.vm.value).toEqual("bar");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user