Merge pull request #2074 from Safelite/rlsmerge/2024.11.07toDevelop

Rlsmerge/2024.11.07to develop
This commit is contained in:
CarlNation 2024-11-06 09:20:34 -05:00 committed by GitHub
commit fc91066ac5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 27 additions and 14 deletions

View file

@ -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
@ -290,6 +291,11 @@ export default {
await this.dispatchStoreAction(storeActions.SAVE_VAPS, this.lineItems.vaps, false); 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);
},
getPromoCodeList() { getPromoCodeList() {
if (this.$refs["promoModalQuestion"]) { if (this.$refs["promoModalQuestion"]) {
return this.$refs["promoModalQuestion"].getPromoCodeList(); return this.$refs["promoModalQuestion"].getPromoCodeList();

View file

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

View file

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