This commit is contained in:
FrankRua 2022-03-29 09:30:26 -04:00
parent 7e51f4be92
commit 5da7037e4d
4 changed files with 10 additions and 4 deletions

6
src/.eslintrc.js Normal file
View file

@ -0,0 +1,6 @@
module.exports = {
env: {
jest: true
},
//...
}

View file

@ -93,7 +93,7 @@ function setupMocks({
categoryValue = "CAR"
}) {
//Mock store
store.dispatch = jest.fn(() => dataFromStoreApi);
store.dispatch = jest.fn(() => {});
store.getters = { vehicle: { category: categoryValue, imageUrl: imageUrlValue } };
const mountOptions = getMountOptions({
store: {

View file

@ -3,7 +3,7 @@ import replaceOptionsQuestion from "@/layouts/vehicle-damage/replace-options-que
import { getMountOptions } from "@/helpers/unit-test-helper.js";
import { nextTick } from "vue";
import store from "@/store";
jest.mock("@/store", () => { return {}; }, {virtual: true});
jest.mock("@/store",()=>{return{};},{virtual:true});
describe("replace-options-question.vue", () => {
test("Selected damage option is emitted upon selection.", async () => {

View file

@ -3,7 +3,7 @@ import sideDoorOptions from "@/layouts/vehicle-damage/side-door-options/side-doo
import { getMountOptions } from "@/helpers/unit-test-helper.js";
import replaceOptionsQuestion from "@/layouts/vehicle-damage/replace-options-question/replace-options-question";
import store from "@/store";
jest.mock("@/store", () => { return {}; }, {virtual: true});
jest.mock("@/store",()=>{return{};},{virtual:true});
describe("replace-options-question.vue", () => {
test("Selected side door option is emitted upon selection.", async () => {
@ -95,7 +95,7 @@ describe("replace-options-question.vue", () => {
}) {
//Mock store
store.dispatch = jest.fn(() => dataFromStoreApi);
store.dispatch = jest.fn(() => {});
store.getters = { vehicle: {year: 2019, make: 'honda', model: 'civc', style: '2 Door', category: 'CAR'} };
const mountOptions = getMountOptions({
store: {