2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-16 09:10:33 +03:00

Further progress on test suite migration, all tests moved out of old files

This commit is contained in:
Jeff
2018-08-11 22:44:06 -07:00
parent d4954de84d
commit 143874a58c
13 changed files with 1435 additions and 1794 deletions
+20
View File
@@ -0,0 +1,20 @@
import { shallowMount } from "@vue/test-utils";
import VueSelect from "../../src/components/Select";
describe("Reset on options change", () => {
it("should not reset the selected value by default when the options property changes", () => {
const Select = shallowMount(VueSelect, {
propsData: { value: "one", options: ["one"] }
});
Select.vm.mutableOptions = ["four", "five", "six"];
expect(Select.vm.mutableValue).toEqual("one");
});
it("should reset the selected value when the options property changes", () => {
const Select = shallowMount(VueSelect, {
propsData: { resetOnOptionsChange: true, value: "one", options: ["one"] }
});
Select.vm.mutableOptions = ["four", "five", "six"];
expect(Select.vm.mutableValue).toEqual(null);
});
});