fix tests
This commit is contained in:
parent
0c75e9a311
commit
d361a161bb
1 changed files with 15 additions and 0 deletions
|
|
@ -8,6 +8,7 @@ import { useMainStore } from '@/store';
|
||||||
import issPageValues from '@/router/router-constants/issPage-values';
|
import issPageValues from '@/router/router-constants/issPage-values';
|
||||||
import { paymentMethods } from '@/constants/payment-method-constants';
|
import { paymentMethods } from '@/constants/payment-method-constants';
|
||||||
import queryStrings from '@/constants/query-strings';
|
import queryStrings from '@/constants/query-strings';
|
||||||
|
import { experimentSettings } from '@/constants/experiments';
|
||||||
|
|
||||||
function setupMocks({ customMountOptions = {}, queryString }) {
|
function setupMocks({ customMountOptions = {}, queryString }) {
|
||||||
const mountOptions = getMountOptions({
|
const mountOptions = getMountOptions({
|
||||||
|
|
@ -15,6 +16,20 @@ function setupMocks({ customMountOptions = {}, queryString }) {
|
||||||
route: { query: { issPage: issPageValues.PAYMENT_METHOD, ...queryString }, params: {} }
|
route: { query: { issPage: issPageValues.PAYMENT_METHOD, ...queryString }, params: {} }
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const mockMixin = {
|
||||||
|
methods: {
|
||||||
|
getSettingValue: jest.fn((settingName) => {
|
||||||
|
if (settingName === experimentSettings.ISS_DISPLAY_PAY_IN_ADVANCE) {
|
||||||
|
return 'true';
|
||||||
|
}
|
||||||
|
|
||||||
|
return 'false';
|
||||||
|
})
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
mountOptions.global.mixins = [mockMixin];
|
||||||
|
|
||||||
const wrapper = shallowMount(paymentMethod, mountOptions);
|
const wrapper = shallowMount(paymentMethod, mountOptions);
|
||||||
|
|
||||||
return wrapper;
|
return wrapper;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue