CSR-2253
CSR-2253 if we're loading a session and we do not have a provider number yet, then set isInsurance to null so that a service package is not selected by default on the quote page.
This commit is contained in:
parent
3654b58914
commit
ee79be8396
5 changed files with 36 additions and 10 deletions
|
|
@ -3,4 +3,4 @@ const externalParameterStatus = {
|
||||||
ACTIVE: 1,
|
ACTIVE: 1,
|
||||||
INACTIVE: 0,
|
INACTIVE: 0,
|
||||||
};
|
};
|
||||||
export { externalParameterStatus };
|
export { externalParameterStatus };
|
||||||
|
|
|
||||||
|
|
@ -73,9 +73,13 @@ jest.mock("@/mixins/experiment-mixin.js", () => ({
|
||||||
if (settingName === mockExperimentSettings.SERVICE_PACKAGE_DISCOUNT) {
|
if (settingName === mockExperimentSettings.SERVICE_PACKAGE_DISCOUNT) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (settingName === mockExperimentSettings.INSURANCE_TAB_TO_DISPLAY_THRESHOLD_INTERNAL) {
|
if (
|
||||||
|
settingName === mockExperimentSettings.INSURANCE_TAB_TO_DISPLAY_THRESHOLD_INTERNAL
|
||||||
|
) {
|
||||||
return 300;
|
return 300;
|
||||||
} else if (settingName === mockExperimentSettings.INSURANCE_TAB_TO_DISPLAY_THRESHOLD_EXTERNAL) {
|
} else if (
|
||||||
|
settingName === mockExperimentSettings.INSURANCE_TAB_TO_DISPLAY_THRESHOLD_EXTERNAL
|
||||||
|
) {
|
||||||
return 500;
|
return 500;
|
||||||
}
|
}
|
||||||
return "test";
|
return "test";
|
||||||
|
|
@ -273,7 +277,7 @@ describe("quote.vue", () => {
|
||||||
};
|
};
|
||||||
const { wrapper } = setupMocks({});
|
const { wrapper } = setupMocks({});
|
||||||
|
|
||||||
//mock this to avoid needing to populate this.$route in an unrelated test
|
//mock this to avoid needing to populate this.$route in an unrelated test
|
||||||
wrapper.vm.getDefaultIsInsuranceSelectedValue = jest.fn();
|
wrapper.vm.getDefaultIsInsuranceSelectedValue = jest.fn();
|
||||||
|
|
||||||
//Act
|
//Act
|
||||||
|
|
|
||||||
|
|
@ -265,7 +265,10 @@ router.beforeEach(async (to, from, next) => {
|
||||||
);
|
);
|
||||||
// If alert event is on the bus, then display the alert
|
// If alert event is on the bus, then display the alert
|
||||||
if (alertEvent !== undefined || unknownAlertEvent !== undefined) {
|
if (alertEvent !== undefined || unknownAlertEvent !== undefined) {
|
||||||
store.commit(storeMutations.UPDATE_IS_EXTERNAL_PARAMETER, externalParameterStatus.INACTIVE);
|
store.commit(
|
||||||
|
storeMutations.UPDATE_IS_EXTERNAL_PARAMETER,
|
||||||
|
externalParameterStatus.INACTIVE
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// fromPaymentToConfirmation workaround for navigating from an iframe but
|
// fromPaymentToConfirmation workaround for navigating from an iframe but
|
||||||
|
|
|
||||||
|
|
@ -680,7 +680,17 @@ export const mutations = {
|
||||||
sessionInformation.order.serviceLocation.provider?.address?.zipCodeCtu;
|
sessionInformation.order.serviceLocation.provider?.address?.zipCodeCtu;
|
||||||
state.order.serviceLocation.techNotes = sessionInformation.order.serviceLocation.techNotes;
|
state.order.serviceLocation.techNotes = sessionInformation.order.serviceLocation.techNotes;
|
||||||
|
|
||||||
state.order.payment.isInsurance = sessionInformation.order.payment.isInsurance;
|
// if we're loading a session and we do not have a provider number yet, then set isInsurance to null so that
|
||||||
|
// a service package is not selected by default on the quote page.
|
||||||
|
if (
|
||||||
|
!sessionInformation.order.payment.isInsurance &&
|
||||||
|
!sessionInformation.order.serviceLocation.provider?.providerNumer
|
||||||
|
) {
|
||||||
|
state.order.payment.isInsurance = null;
|
||||||
|
} else {
|
||||||
|
state.order.payment.isInsurance = sessionInformation.order.payment.isInsurance;
|
||||||
|
}
|
||||||
|
|
||||||
state.order.payment.insuranceCoverage.isVerified =
|
state.order.payment.insuranceCoverage.isVerified =
|
||||||
coverageStatusValue(sessionInformation?.order.insuranceCoverage.coverageStatus) ===
|
coverageStatusValue(sessionInformation?.order.insuranceCoverage.coverageStatus) ===
|
||||||
coverageStatus.VERIFIED
|
coverageStatus.VERIFIED
|
||||||
|
|
|
||||||
|
|
@ -2934,7 +2934,10 @@ describe("Actions", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const context = state;
|
const context = state;
|
||||||
const promoCode = "testPromo";
|
const promoCode = "testPromo";
|
||||||
const lineItemsToUse = { vaps: [{ partNumber: 1 }], promos: [{ promoCode: "1wiper0" }] };
|
const lineItemsToUse = {
|
||||||
|
vaps: [{ partNumber: 1 }],
|
||||||
|
promos: [{ promoCode: "1wiper0" }],
|
||||||
|
};
|
||||||
const addableVaps = [{ partNumber: "addableVap" }];
|
const addableVaps = [{ partNumber: "addableVap" }];
|
||||||
|
|
||||||
context["getters"] = {
|
context["getters"] = {
|
||||||
|
|
@ -3058,7 +3061,10 @@ describe("Actions", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const context = state;
|
const context = state;
|
||||||
const promoCode = "testPromo";
|
const promoCode = "testPromo";
|
||||||
const lineItemsToUse = { vaps: [{ partNumber: 1 }], promos: [{ promoCode: "1wiper0" }] };
|
const lineItemsToUse = {
|
||||||
|
vaps: [{ partNumber: 1 }],
|
||||||
|
promos: [{ promoCode: "1wiper0" }],
|
||||||
|
};
|
||||||
const addableVaps = [{ partNumber: "addableVap" }];
|
const addableVaps = [{ partNumber: "addableVap" }];
|
||||||
|
|
||||||
context["getters"] = {
|
context["getters"] = {
|
||||||
|
|
@ -3151,7 +3157,10 @@ describe("Actions", () => {
|
||||||
|
|
||||||
crypto.randomUUID = jest.fn(() => "GUID");
|
crypto.randomUUID = jest.fn(() => "GUID");
|
||||||
|
|
||||||
const expectedLineItemsOnOrder = [{ partNumber: 1, isChildPart: false, id: "GUID" }, { promoCode: "1wiper0", isChildPart: false }];
|
const expectedLineItemsOnOrder = [
|
||||||
|
{ partNumber: 1, isChildPart: false, id: "GUID" },
|
||||||
|
{ promoCode: "1wiper0", isChildPart: false },
|
||||||
|
];
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
actions.validateOrderPromoAndSaveServerData(context, {
|
actions.validateOrderPromoAndSaveServerData(context, {
|
||||||
|
|
@ -3440,7 +3449,7 @@ describe("Actions", () => {
|
||||||
lineItems: {
|
lineItems: {
|
||||||
serverData: "test",
|
serverData: "test",
|
||||||
promos: [{ promoCode: "test", isChildPart: false }],
|
promos: [{ promoCode: "test", isChildPart: false }],
|
||||||
vaps: [{ partNumber: "testVap", isChildPart:false, id: "providedId" }],
|
vaps: [{ partNumber: "testVap", isChildPart: false, id: "providedId" }],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue