Merge pull request #2151 from Safelite/feature/CSR-2416

CSR-2416
This commit is contained in:
AMSNEHA 2024-11-28 17:46:09 +05:30 committed by GitHub
commit 82893a222b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 23 additions and 3 deletions

View file

@ -298,8 +298,8 @@ export default {
this.lineItems[category] = this.lineItems[category].filter(
(lineItemsToKeep) => lineItemsToKeep.cartItemType != cartItemType
);
if (category == cartItemCategories.VAPS) {
await this.dispatchStoreAction(storeActions.SAVE_VAPS, this.lineItems.vaps, false);
if (category == cartItemCategories.VAPS || category == cartItemCategories.PROMOS) {
this.saveVaps(this.lineItems);
}
if (category == cartItemCategories.SUPPORTING_ITEMS) {
await this.dispatchStoreAction(
@ -750,7 +750,8 @@ export default {
return this.getCmsContent("RecycleFeeTextWidget", "Text");
},
showRecycleFeeCartItem() {
if (!this.isInsurance || this.isItac || this.isNoComp) { // CASH, ITAC, NOCOMP ORDERS
if (!this.isInsurance || this.isItac || this.isNoComp) {
// CASH, ITAC, NOCOMP ORDERS
return !this.isRepair;
} else {
return false;

View file

@ -19,6 +19,11 @@ jest.mock("@/mixins/base-mixin", () => ({
return mockReturnsForStoreActions[action];
}
),
dispatchStoreAction: jest.fn(
(action, { promoCode, addableVaps }, pageNameToLog, someBool) => {
return mockReturnsForStoreActions[action];
}
),
},
}));
@ -286,6 +291,13 @@ describe("promo-modal-question.vue", () => {
(lineItemsToKeep) =>
getPromoCodeWithoutBundleIdentifier(lineItemsToKeep.promoCode) != promo
));
await baseMixin.methods.dispatchStoreAction(
storeActions.SAVE_ACTIVE_AND_OR_INACTIVE_PROMOS,
{
activePromos: lineItems.promos,
},
false
);
//Assert
expect(existingPromo).toEqual(lineItems.promos);

View file

@ -230,6 +230,13 @@ export default {
(lineItemsToKeep) =>
getPromoCodeWithoutBundleIdentifier(lineItemsToKeep.promoCode) != promo
);
await baseMixin.methods.dispatchStoreAction(
storeActions.SAVE_ACTIVE_AND_OR_INACTIVE_PROMOS,
{
activePromos: this.lineItems.promos,
},
false
);
},
getErrorMessage(error, additionalInfo) {
switch (error) {