-
+
@@ -30,7 +27,6 @@
// Components
import funnelHeader from "@/fmg-components/funnel-header/funnel-header";
import navbar from "@/fmg-components/nav-bar/nav-bar";
-import vehicleBanner from "@/fmg-components/vehicle-banner/vehicle-banner";
import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header";
import loadingModal from "@/fmg-components/loading-modal/loading-modal.vue";
@@ -71,7 +67,6 @@ export default {
components: {
funnelHeader,
navbar,
- vehicleBanner,
funnelSubHeader,
loadingModal,
},
diff --git a/src/layouts/confirmation/confirmation.spec.js b/src/layouts/confirmation/confirmation.spec.js
index 166973ce6..2141d0591 100644
--- a/src/layouts/confirmation/confirmation.spec.js
+++ b/src/layouts/confirmation/confirmation.spec.js
@@ -9,6 +9,10 @@ import { nextTick } from "vue";
import { getMountOptions } from "@/helpers/unit-test-helper.js";
import store from "@/store";
import router from "@/router";
+import experimentMixin from "@/mixins/experiment-mixin.js";
+import { experimentSettings } from "@/constants/experiments";
+
+const mockExperimentSettings = experimentSettings;
// Mock our module for promises.
jest.mock("@/helpers/layout-helper.js", () => ({
@@ -66,6 +70,9 @@ beforeEach(() => {
customer: {
emailAddress: "test@test.com",
},
+ policy: {
+ isNoComp: false,
+ },
},
damage: {},
payment: {
@@ -237,7 +244,7 @@ describe("computed properties...", () => {
const testValue = wrapper.vm.AppointmentWordingText;
// Assert
- expect(testValue).toEqual("wording Text 123, test,
test, AZ 12345");
+ expect(testValue).toEqual("wording Text test, 123,
test, AZ 12345");
});
test("AppointmentWordingText should return DROP_OFF text in expected format.", () => {
//Arrange
@@ -419,7 +426,7 @@ describe("computed properties...", () => {
const testValue = wrapper.vm.ServiceLocationFullAddress;
// Assert
- expect(testValue).toEqual("123, test,
test, AZ 12345");
+ expect(testValue).toEqual("test, 123,
test, AZ 12345");
});
test("ProviderFullAddress should return text in expected format.", () => {
//Arrange
@@ -552,6 +559,140 @@ describe("computed properties...", () => {
// Assert
expect(testValue).toEqual("Duration: Overnight");
});
+
+ test("NoComp should return false for shouldHideRecalibration", () => {
+ //Arrange
+ const { wrapper } = setupMocks({});
+ wrapper.vm.submittedOrder = {
+ vehicle: {
+ imageUrl: "",
+ },
+ schedule: {
+ endTime: "10:00",
+ date: "2024-09-28",
+ jobMaxMinutes: 120,
+ jobMinMinutes: 60,
+ routeCode: "",
+ },
+ policy: {
+ isNoComp: true,
+ },
+ serviceLocation: store.getters.order.serviceLocation,
+ };
+ wrapper.vm.submittedOrder.serviceLocation.appointmentType = AppointmentTypeStrings.MOBILE;
+ // Act
+ const testValue = wrapper.vm.shouldHideRecalibration;
+
+ // Assert
+ expect(testValue).toEqual(false);
+ });
+ test("Itac should return false for shouldHideRecalibration", () => {
+ //Arrange
+ const { wrapper } = setupMocks({});
+ wrapper.vm.submittedOrder = {
+ vehicle: {
+ imageUrl: "",
+ },
+ schedule: {
+ endTime: "10:00",
+ date: "2024-09-28",
+ jobMaxMinutes: 120,
+ jobMinMinutes: 60,
+ routeCode: "",
+ },
+ policy: {
+ isItac: true,
+ },
+ serviceLocation: store.getters.order.serviceLocation,
+ };
+ wrapper.vm.submittedOrder.serviceLocation.appointmentType = AppointmentTypeStrings.MOBILE;
+ // Act
+ const testValue = wrapper.vm.shouldHideRecalibration;
+
+ // Assert
+ expect(testValue).toEqual(false);
+ });
+ test("Not Itac/NoComp with Recal should return true for shouldHideRecalibration", async () => {
+ //Arrange
+ const { wrapper } = setupMocks({});
+ const lineItems = {
+ glassParts: [
+ {
+ partType: "RECALIBRATION",
+ },
+ ],
+ };
+
+ wrapper.vm.submittedOrder = {
+ vehicle: {
+ imageUrl: "",
+ },
+ schedule: {
+ endTime: "10:00",
+ date: "2024-09-28",
+ jobMaxMinutes: 120,
+ jobMinMinutes: 60,
+ routeCode: "",
+ },
+ policy: {
+ isItac: false,
+ isNoComp: false,
+ },
+ lineItems: {
+ glassParts: {
+ partType: "Recalibration",
+ },
+ },
+ serviceLocation: store.getters.order.serviceLocation,
+ };
+
+ wrapper.setData({ lineItems: lineItems });
+ await wrapper.vm.$nextTick();
+
+ // Act
+ const testValue = wrapper.vm.shouldHideRecalibration;
+
+ // Assert
+ expect(testValue).toEqual(true);
+ });
+ test("Itac/NoComp with Recal should return false for shouldHideRecalibration", async () => {
+ //Arrange
+ const { wrapper } = setupMocks({});
+ const lineItems = {
+ glassParts: [
+ {
+ partType: "RECALIBRATION",
+ },
+ ],
+ };
+
+ wrapper.vm.submittedOrder = {
+ vehicle: {
+ imageUrl: "",
+ },
+ schedule: {
+ endTime: "10:00",
+ date: "2024-09-28",
+ jobMaxMinutes: 120,
+ jobMinMinutes: 60,
+ routeCode: "",
+ },
+ policy: {
+ isItac: true,
+ isNoComp: false,
+ },
+ serviceLocation: store.getters.order.serviceLocation,
+ };
+
+ wrapper.setData({ lineItems: lineItems });
+ await wrapper.vm.$nextTick();
+
+ // Act
+ const testValue = wrapper.vm.shouldHideRecalibration;
+
+ // Assert
+ expect(testValue).toEqual(false);
+ });
});
function setupMocks({ customMountOptions }) {
@@ -565,10 +706,17 @@ function setupMocks({ customMountOptions }) {
getCmsContent: jest.fn().mockImplementation(() => {
return wordingText;
}),
- getSettingValue: jest.fn(),
+ getSettingValue: jest.fn((settingName) => {
+ if (settingName === experimentSettings.RECAL_PRICE_REMOVE) {
+ return "true";
+ }
+
+ return "false";
+ }),
},
},
];
+
const wrapper = shallowMount(confirmation, mountOptions);
return { wrapper };
}
diff --git a/src/layouts/confirmation/confirmation.vue b/src/layouts/confirmation/confirmation.vue
index 1d77585b3..f8b27a01e 100644
--- a/src/layouts/confirmation/confirmation.vue
+++ b/src/layouts/confirmation/confirmation.vue
@@ -16,10 +16,7 @@