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

chore: yarn upgrade (#1062)

* chore: yarn upgrade

* upgrade vue test utils

* fix selectable suite

* fix slot suite

* fix ajax suite

* fix reactive options suite

* fix typeahead suite

* fix reduce tests

* fix tagging suite

* fix deselecting

* fix deselecting

* fix deselecting
This commit is contained in:
Jeff Sagal
2020-02-29 08:30:32 -08:00
committed by GitHub
parent ea8fdbf237
commit add1a5282b
11 changed files with 1187 additions and 1211 deletions
+8 -2
View File
@@ -1,27 +1,33 @@
import { selectWithProps } from "../helpers";
describe("Selectable prop", () => {
it("should select selectable option if clicked", () => {
it("should select selectable option if clicked", async () => {
const Select = selectWithProps({
options: ["one", "two", "three"],
selectable: (option) => option === "one"
});
Select.vm.$data.open = true;
await Select.vm.$nextTick();
Select.find(".vs__dropdown-menu li:first-child").trigger("mousedown");
await Select.vm.$nextTick();
expect(Select.vm.selectedValue).toEqual(["one"]);
})
it("should not select not selectable option if clicked", () => {
it("should not select not selectable option if clicked", async () => {
const Select = selectWithProps({
options: ["one", "two", "three"],
selectable: (option) => option === "one"
});
Select.vm.$data.open = true;
await Select.vm.$nextTick();
Select.find(".vs__dropdown-menu li:last-child").trigger("mousedown");
await Select.vm.$nextTick();
expect(Select.vm.selectedValue).toEqual([]);
});