CASH-462 | Update unit tests
This commit is contained in:
parent
565c9408f6
commit
2d9b59eab4
4 changed files with 19 additions and 1 deletions
|
|
@ -7,7 +7,6 @@ import { getMountOptions } from "@/helpers/unit-test-helper.js";
|
|||
import store from "@/store";
|
||||
import router from "@/router";
|
||||
import baseMixin from "../../mixins/base-mixin";
|
||||
import { experimentSettings } from "../../constants/experiments";
|
||||
|
||||
// Mock basemixin
|
||||
jest.mock("@/mixins/base-mixin.js", () => ({
|
||||
|
|
@ -147,6 +146,9 @@ beforeEach(() => {
|
|||
jest.restoreAllMocks();
|
||||
jest.clearAllMocks();
|
||||
store.getters = {
|
||||
applicationUser: {
|
||||
experiments: []
|
||||
},
|
||||
order: {
|
||||
schedule: {
|
||||
date: "2019-01-01",
|
||||
|
|
|
|||
|
|
@ -174,6 +174,7 @@ const mockMixin = {
|
|||
|
||||
beforeEach(() => {
|
||||
store.getters = {
|
||||
applicationUser: {experiments: []},
|
||||
lineItems: {
|
||||
supportingItems: [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -173,9 +173,14 @@ function resetMockStoreData() {
|
|||
};
|
||||
}
|
||||
|
||||
const applicationUser = {
|
||||
experiments: []
|
||||
};
|
||||
|
||||
function applyMockStoreDataToGetters() {
|
||||
store.getters = {
|
||||
experimentSettings: mockExperimentSettings,
|
||||
applicationUser: applicationUser,
|
||||
order: mockStoreData,
|
||||
damage: mockStoreData.damage,
|
||||
payment: mockStoreData.payment,
|
||||
|
|
|
|||
|
|
@ -135,6 +135,16 @@ function setupMocks({ experimentSettings }) {
|
|||
|
||||
store.getters = {
|
||||
experimentSettings: experimentSettings ?? testExperimentSettings,
|
||||
applicationUser: {
|
||||
experiments: [
|
||||
{
|
||||
isActive: true,
|
||||
isExposed: true,
|
||||
settings: experimentSettings ?? testExperimentSettings
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
const mockComponent = {
|
||||
|
|
|
|||
Loading…
Reference in a new issue