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:
CarlNation 2024-10-15 09:36:30 -04:00
parent 3654b58914
commit ee79be8396
5 changed files with 36 additions and 10 deletions

View file

@ -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";

View file

@ -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

View file

@ -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

View file

@ -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" }],
}, },
}, },
}; };