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

add Jest suite from vue-cli-3 branch

This commit is contained in:
Jeff
2019-02-10 14:38:30 -08:00
parent 4ed24ab2e3
commit e03c642615
13 changed files with 1330 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
import { shallowMount } from "@vue/test-utils";
import VueSelect from "../src/components/Select";
/**
* Trigger a submit event on the search
* input with a provided search text.
*
* @param Wrapper {Wrapper<Vue>}
* @param searchText
*/
export const searchSubmit = (Wrapper, searchText = false) => {
if (searchText) {
Wrapper.vm.search = searchText;
}
Wrapper.find({ ref: "search" }).trigger("keydown", {
keyCode: 13
});
};
/**
* Create a new VueSelect instance with
* a provided set of props.
* @param propsData
* @returns {Wrapper<Vue>}
*/
export const selectWithProps = (propsData = {}) => {
return shallowMount(VueSelect, { propsData });
};