Formatting

This commit is contained in:
Chloe Herd 2024-06-19 15:21:51 -04:00
parent e5c8378197
commit 156c05a903

View file

@ -76,31 +76,33 @@ function resetMockStoreData() {
damageCause: null,
},
lineItems: {
glassParts: [{
canSafeliteRecalibrate: true,
childParts: [
{
kitPrice: 0,
laborAmount: 23.55,
partNumber: "GGG FW4896",
salesTax: 1.77,
sellingPrice: 0,
},
],
color: "Green Tint",
description:
"solar, soundproofing, lane keep assist, lane departure warning system, w/adaptive cruise control",
id: "db22fd44-10dd-456f-979b-ff88cf68cca6",
kitPrice: 0,
laborAmount: 60,
partNumber: "FW04896GTYN",
partType: "WINDSHIELD",
recalibrationType: "STATIC",
requiresCapabilityQuestions: false,
requiresRecalibration: true,
salesTax: 63.86,
sellingPrice: 791.46,
}],
glassParts: [
{
canSafeliteRecalibrate: true,
childParts: [
{
kitPrice: 0,
laborAmount: 23.55,
partNumber: "GGG FW4896",
salesTax: 1.77,
sellingPrice: 0,
},
],
color: "Green Tint",
description:
"solar, soundproofing, lane keep assist, lane departure warning system, w/adaptive cruise control",
id: "db22fd44-10dd-456f-979b-ff88cf68cca6",
kitPrice: 0,
laborAmount: 60,
partNumber: "FW04896GTYN",
partType: "WINDSHIELD",
recalibrationType: "STATIC",
requiresCapabilityQuestions: false,
requiresRecalibration: true,
salesTax: 63.86,
sellingPrice: 791.46,
},
],
supportingItems: null,
vaps: null,
serverData: null,
@ -234,7 +236,7 @@ describe("service-zip.vue", () => {
});
// Assert
expect(wrapper.vm.serviceZipCode).toEqual("11111")
expect(wrapper.vm.serviceZipCode).toEqual("11111");
});
});
@ -254,7 +256,10 @@ describe("service-zip.vue", () => {
await wrapper.vm.backButtonAction();
// Assert
expect(wrapper.vm.$router.navigateWithoutSaving).toBeCalledWith(navigationScenarios.CLICKED_BACK_WITH_SKIP_VIN, wrapper.vm.$route);
expect(wrapper.vm.$router.navigateWithoutSaving).toBeCalledWith(
navigationScenarios.CLICKED_BACK_WITH_SKIP_VIN,
wrapper.vm.$route
);
});
test("If not skipvin eligable, go back to estimate", async () => {
@ -267,7 +272,10 @@ describe("service-zip.vue", () => {
await wrapper.vm.backButtonAction();
// Assert
expect(wrapper.vm.$router.navigateWithoutSaving).toBeCalledWith(navigationScenarios.CLICKED_BACK, wrapper.vm.$route);
expect(wrapper.vm.$router.navigateWithoutSaving).toBeCalledWith(
navigationScenarios.CLICKED_BACK,
wrapper.vm.$route
);
});
});
@ -285,15 +293,18 @@ describe("service-zip.vue", () => {
const wrapper = setupMocks({});
jest.spyOn(wrapper.vm, "navigateForwardWithSingleCarMatch").mockImplementation();
await wrapper.vm.forwardButtonAction();
// Assert
expect(wrapper.vm.$router.navigateWithSaving).toBeCalledWith(navigationScenarios.CLICKED_FORWARD_WITH_NO_QUESTIONS, wrapper.vm.$route);
expect(wrapper.vm.$router.navigateWithSaving).toBeCalledWith(
navigationScenarios.CLICKED_FORWARD_WITH_NO_QUESTIONS,
wrapper.vm.$route
);
expect(wrapper.vm.navigateForwardWithSingleCarMatch).not.toBeCalled();
});
test("Non-repair enters questions flow", async () => {
test("Non-repair enters questions flow", async () => {
// Arrange
mockStoreData.damage.isRepair = false;
applyMockStoreDataToGetters();
@ -302,7 +313,7 @@ describe("service-zip.vue", () => {
const wrapper = setupMocks({});
jest.spyOn(wrapper.vm, "navigateForwardWithSingleCarMatch").mockImplementation();
await wrapper.vm.forwardButtonAction();
// Assert
@ -325,8 +336,8 @@ describe("service-zip.vue", () => {
};
// Act
const wrapper = setupMocks({customZipDataResponse: invalidZipResponse});
const wrapper = setupMocks({ customZipDataResponse: invalidZipResponse });
wrapper.vm.$refs.navbar.removeLoader = jest.fn();
await wrapper.vm.forwardButtonAction();
@ -347,8 +358,8 @@ describe("service-zip.vue", () => {
};
// Act
const wrapper = setupMocks({customZipDataResponse: invalidZipResponse});
const wrapper = setupMocks({ customZipDataResponse: invalidZipResponse });
wrapper.vm.$refs.navbar.removeLoader = jest.fn();
await wrapper.vm.forwardButtonAction();
@ -364,7 +375,7 @@ describe("service-zip.vue", () => {
// Act
const wrapper = setupMocks({});
wrapper.vm.displayInvalidZipAlert = true;
wrapper.vm.displayNonServiceableZipAlert = true;
@ -381,10 +392,10 @@ describe("service-zip.vue", () => {
function setupMocks({ customMountOptions, customZipQuery, customZipDataResponse }) {
const route = { query: { fmgPage: "service-zip" }, params: {} };
if(customZipQuery) {
if (customZipQuery) {
route.query.zipcode = customZipQuery;
}
const mountOptions = getMountOptions({
...customMountOptions,
route: route,
@ -402,7 +413,7 @@ function setupMocks({ customMountOptions, customZipQuery, customZipDataResponse
setCmsContent: jest.fn(),
navigateForwardWithSingleCarMatch: jest.fn(),
getZipCodeData: jest.fn().mockImplementation(() => {
if(customZipDataResponse) {
if (customZipDataResponse) {
return customZipDataResponse;
} else {
return {