2022-03-25 14:14:49 +00:00
|
|
|
import { mount, flushPromises } from '@vue/test-utils';
|
|
|
|
import { installQuasarPlugin } from '@quasar/quasar-app-extension-testing-unit-jest';
|
|
|
|
import { i18n } from 'src/boot/i18n';
|
|
|
|
import { Notify } from 'quasar';
|
|
|
|
import axios from 'axios';
|
|
|
|
|
|
|
|
// Specify here Quasar config you'll need to test your component
|
|
|
|
installQuasarPlugin({
|
|
|
|
plugins: {
|
|
|
|
Notify
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2022-06-21 05:42:33 +00:00
|
|
|
export function createWrapper(component, options) {
|
|
|
|
const mountOptions = {
|
2022-03-25 14:14:49 +00:00
|
|
|
global: {
|
|
|
|
plugins: [i18n]
|
|
|
|
}
|
2022-06-21 05:42:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
if (options instanceof Object)
|
|
|
|
Object.assign(mountOptions, options)
|
|
|
|
|
|
|
|
const wrapper = mount(component, mountOptions);
|
2022-03-25 14:14:49 +00:00
|
|
|
const vm = wrapper.vm;
|
|
|
|
|
|
|
|
return { vm, wrapper };
|
|
|
|
}
|
|
|
|
|
|
|
|
export {
|
|
|
|
axios,
|
|
|
|
flushPromises
|
|
|
|
}
|