Fixed service-location tests for new code

This commit is contained in:
Leah Schumann 2023-02-28 10:32:03 -05:00
parent c02df2ca9d
commit e05a1bf51b

View file

@ -8,6 +8,7 @@ import baseMixin from "@/mixins/base-mixin";
import { nextTick } from "vue";
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
import { settleAllPromises } from "@/helpers/layout-helper.js";
import { getMobileFee } from "@/helpers/service-location-helper";
import store from "@/store";
// Define Mocks
@ -19,6 +20,10 @@ jest.mock("@/helpers/cms-content-helper", () => ({
fetchCmsContentForPage: jest.fn(),
}));
jest.mock("@/helpers/service-location-helper", () => ({
getMobileFee: jest.fn(),
}));
jest.mock("@/store", () => ({
commit: jest.fn(),
dispatch: jest.fn(),
@ -116,7 +121,7 @@ describe("service-location.vue", () => {
expect(wrapper.vm.mobileLocationQuestions.serviceZipCode).toBe(newZip);
});
test("updates service zip code serviceZipCodeQuestion when resetServiceZipCode is called", () => {
test.only("updates service zip code serviceZipCodeQuestion when resetServiceZipCode is called", () => {
// Arrange
const { wrapper } = setupMocks({});
const newServiceZipCodeQuestion = {
@ -163,6 +168,7 @@ function setupMocks({ mountOptionsMockData = {} }) {
settleAllPromises.mockImplementation(() => apiPromise);
fetchCmsContentForPage.mockImplementation(() => Promise.resolve());
getMobileFee.mockImplementation(() => Promise.resolve());
const mountOptions = getMountOptions(mountOptionsMockData);
const wrapper = shallowMount(serviceLocation, mountOptions);