Merge pull request #2074 from Safelite/rlsmerge/2024.11.07toDevelop
Rlsmerge/2024.11.07to develop
This commit is contained in:
commit
fc91066ac5
3 changed files with 27 additions and 14 deletions
|
|
@ -134,7 +134,8 @@
|
||||||
v-model="lineItems"
|
v-model="lineItems"
|
||||||
:addableVaps="availableVaps"
|
:addableVaps="availableVaps"
|
||||||
:pageName="pageName"
|
:pageName="pageName"
|
||||||
modalWidgetName="PromoModalWidget" />
|
modalWidgetName="PromoModalWidget"
|
||||||
|
@promoAdded="saveVaps" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
|
@ -286,7 +287,12 @@ export default {
|
||||||
this.lineItems[category] = this.lineItems[category].filter(
|
this.lineItems[category] = this.lineItems[category].filter(
|
||||||
(lineItemsToKeep) => lineItemsToKeep.cartItemType != cartItemType
|
(lineItemsToKeep) => lineItemsToKeep.cartItemType != cartItemType
|
||||||
);
|
);
|
||||||
|
|
||||||
|
await this.dispatchStoreAction(storeActions.SAVE_VAPS, this.lineItems.vaps, false);
|
||||||
|
},
|
||||||
|
|
||||||
|
async saveVaps(vaps) {
|
||||||
|
this.lineItems.vaps = [...vaps];
|
||||||
await this.dispatchStoreAction(storeActions.SAVE_VAPS, this.lineItems.vaps, false);
|
await this.dispatchStoreAction(storeActions.SAVE_VAPS, this.lineItems.vaps, false);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -220,7 +220,7 @@ export default {
|
||||||
additionalInfo: promoValidationResponse?.additionalInfo,
|
additionalInfo: promoValidationResponse?.additionalInfo,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
removeItem(promo) {
|
async removeItem(promo) {
|
||||||
this.lineItems[cartItemCategories.PROMOS] = this.lineItems[
|
this.lineItems[cartItemCategories.PROMOS] = this.lineItems[
|
||||||
cartItemCategories.PROMOS
|
cartItemCategories.PROMOS
|
||||||
].filter(
|
].filter(
|
||||||
|
|
@ -320,6 +320,9 @@ export default {
|
||||||
this.lineItems.vaps?.push(...getVaps);
|
this.lineItems.vaps?.push(...getVaps);
|
||||||
}
|
}
|
||||||
this.lineItems?.promos.push(...promoCodeData.promoCode);
|
this.lineItems?.promos.push(...promoCodeData.promoCode);
|
||||||
|
|
||||||
|
this.$emit('promoAdded', this.lineItems.vaps);
|
||||||
|
|
||||||
this.closeModal();
|
this.closeModal();
|
||||||
} else {
|
} else {
|
||||||
this.getErrorMessage(promoCodeData.errorCode, promoCodeData.additionalInfo);
|
this.getErrorMessage(promoCodeData.errorCode, promoCodeData.additionalInfo);
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ beforeEach(() => {
|
||||||
},
|
},
|
||||||
policy: {
|
policy: {
|
||||||
isNoComp: false,
|
isNoComp: false,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
damage: {},
|
damage: {},
|
||||||
payment: {
|
payment: {
|
||||||
|
|
@ -616,9 +616,11 @@ describe("computed properties...", () => {
|
||||||
//Arrange
|
//Arrange
|
||||||
const { wrapper } = setupMocks({});
|
const { wrapper } = setupMocks({});
|
||||||
const lineItems = {
|
const lineItems = {
|
||||||
glassParts: [{
|
glassParts: [
|
||||||
partType: "RECALIBRATION",
|
{
|
||||||
}]
|
partType: "RECALIBRATION",
|
||||||
|
},
|
||||||
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
wrapper.vm.submittedOrder = {
|
wrapper.vm.submittedOrder = {
|
||||||
|
|
@ -639,7 +641,7 @@ describe("computed properties...", () => {
|
||||||
lineItems: {
|
lineItems: {
|
||||||
glassParts: {
|
glassParts: {
|
||||||
partType: "Recalibration",
|
partType: "Recalibration",
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
serviceLocation: store.getters.order.serviceLocation,
|
serviceLocation: store.getters.order.serviceLocation,
|
||||||
};
|
};
|
||||||
|
|
@ -653,13 +655,15 @@ describe("computed properties...", () => {
|
||||||
// Assert
|
// Assert
|
||||||
expect(testValue).toEqual(true);
|
expect(testValue).toEqual(true);
|
||||||
});
|
});
|
||||||
test ("Itac/NoComp with Recal should return false for shouldHideRecalibration", async () => {
|
test("Itac/NoComp with Recal should return false for shouldHideRecalibration", async () => {
|
||||||
//Arrange
|
//Arrange
|
||||||
const { wrapper } = setupMocks({});
|
const { wrapper } = setupMocks({});
|
||||||
const lineItems = {
|
const lineItems = {
|
||||||
glassParts: [{
|
glassParts: [
|
||||||
partType: "RECALIBRATION",
|
{
|
||||||
}]
|
partType: "RECALIBRATION",
|
||||||
|
},
|
||||||
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
wrapper.vm.submittedOrder = {
|
wrapper.vm.submittedOrder = {
|
||||||
|
|
@ -688,7 +692,7 @@ describe("computed properties...", () => {
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(testValue).toEqual(false);
|
expect(testValue).toEqual(false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function setupMocks({ customMountOptions }) {
|
function setupMocks({ customMountOptions }) {
|
||||||
|
|
@ -706,7 +710,7 @@ function setupMocks({ customMountOptions }) {
|
||||||
if (settingName === experimentSettings.RECAL_PRICE_REMOVE) {
|
if (settingName === experimentSettings.RECAL_PRICE_REMOVE) {
|
||||||
return "true";
|
return "true";
|
||||||
}
|
}
|
||||||
|
|
||||||
return "false";
|
return "false";
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue