Merge branch 'develop' into feature/CSR-520
This commit is contained in:
commit
a8eb81f23c
5 changed files with 35 additions and 15 deletions
|
|
@ -23,6 +23,13 @@ export function getDamageString() {
|
|||
return returnString;
|
||||
}
|
||||
|
||||
export function getIsWindshieldOnly () {
|
||||
const damageLocations = store.getters.damage.glassToReplace;
|
||||
const returnString = damageLocations.length === 1 && damageLocations[0]?.location === "Windshield" ? "windshield" : "glass";
|
||||
console.log(damageLocations);
|
||||
return returnString;
|
||||
}
|
||||
|
||||
export async function isGlassAvailableForCarId(carId){
|
||||
const newGlassOptions = await baseMixin.methods.dispatchStoreAction(
|
||||
storeActions.GET_DAMAGE_OPTIONS,
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import licensePlateLookup from "@/layouts/license-plate-lookup/license-plate-loo
|
|||
|
||||
// Supporting Files
|
||||
import { settleAllPromises } from "@/helpers/layout-helper.js";
|
||||
import * as navigateToHeritage from "@/helpers/heritage-integration/navigation-helper";
|
||||
import baseMixin from "@/mixins/base-mixin";
|
||||
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
||||
import { shallowMount, flushPromises } from "@vue/test-utils";
|
||||
|
|
@ -380,16 +381,15 @@ describe("license-plate-lookup.vue", () => {
|
|||
|
||||
//Act
|
||||
wrapper.vm.isCarIdDifferent = false;
|
||||
wrapper.vm.$router.navigateAfterSaveToHeritageFunnel = jest.fn();
|
||||
wrapper.vm.$refs.loadingModal.showModal = jest.fn();
|
||||
wrapper.vm.getCmsContent = jest.fn().mockImplementation(() => {
|
||||
return '';
|
||||
});
|
||||
|
||||
navigateToHeritage.navigateAfterSaveToHeritageFunnel = jest.fn();
|
||||
await wrapper.vm.navigateForward();
|
||||
|
||||
//Assert
|
||||
expect(wrapper.vm.$router.navigateAfterSaveToHeritageFunnel).toHaveBeenCalled();
|
||||
expect(navigateToHeritage.navigateAfterSaveToHeritageFunnel).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -70,6 +70,9 @@ import {
|
|||
import {
|
||||
errorMessages
|
||||
} from "@/constants/error-messages";
|
||||
import {
|
||||
navigateAfterSaveToHeritageFunnel
|
||||
} from "@/helpers/heritage-integration/navigation-helper";
|
||||
import {
|
||||
getDamageString,
|
||||
isGlassAvailableForCarId,
|
||||
|
|
@ -134,6 +137,7 @@ export default {
|
|||
previouslyEnteredCarId: "",
|
||||
customAlertData: {},
|
||||
isSelectedGlassAvailableForVehicle: true,
|
||||
zipToDisplay: this.getRegistrationZipFromStore(),
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
|
@ -171,7 +175,7 @@ export default {
|
|||
let text = this.getCmsContent(
|
||||
"NoServiceZipWidget",
|
||||
"HeadlineText"
|
||||
).replaceAll("{custom:zip}", this.registrationZip);
|
||||
).replaceAll("{custom:zip}", this.zipToDisplay);
|
||||
return text;
|
||||
},
|
||||
NoServiceZipBody() {
|
||||
|
|
@ -223,6 +227,7 @@ export default {
|
|||
this.isVinValid = true;
|
||||
this.isRegistrationZipServicable = false;
|
||||
this.isCarIdDifferent = false;
|
||||
this.zipToDisplay = this.serviceZip ? this.serviceZip : this.registrationZip;
|
||||
return;
|
||||
}
|
||||
const vinLookup = await this.lookupVin(
|
||||
|
|
@ -273,7 +278,7 @@ export default {
|
|||
return;
|
||||
} else {
|
||||
this.$refs.loadingModal.showModal();
|
||||
this.$router.navigateAfterSaveToHeritageFunnel(this.$route);
|
||||
navigateAfterSaveToHeritageFunnel(this.$route);
|
||||
return;
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -108,6 +108,14 @@
|
|||
alertClass="alert-warning"
|
||||
cmsWidgetName="PerfectMatchNewVinAlert"
|
||||
/>
|
||||
<alert
|
||||
class="my-3"
|
||||
:manualHeadline="PerfectMatchNewVinAlertReadOnlyHeader"
|
||||
:manualCopy="PerfectMatchNewVinAlertReadOnlyBody"
|
||||
v-model="customAlertData"
|
||||
v-if="isVinFieldReadOnly"
|
||||
alertClass="alert-success"
|
||||
/>
|
||||
<funnelFooter
|
||||
cmsWidgetName="FunnelFooterWidget"
|
||||
ref="funnelFooter"
|
||||
|
|
@ -146,13 +154,6 @@
|
|||
alertClass="alert-success"
|
||||
cmsWidgetName="PerfectMatchNewVinAlert"
|
||||
/>
|
||||
<funnelFooter
|
||||
cmsWidgetName="FunnelFooterWidget"
|
||||
ref="funnelFooter"
|
||||
:isForwardActionDisabled="!meta.valid"
|
||||
@back-clicked="backButtonAction"
|
||||
@ForwardClicked="forwardButtonAction"
|
||||
/>
|
||||
</div>
|
||||
</Form>
|
||||
</template>
|
||||
|
|
@ -176,7 +177,7 @@ import baseMixin from "@/mixins/base-mixin.js";
|
|||
import { storeActions } from "@/constants/store-actions";
|
||||
import { storeMutations } from "@/constants/store-mutations";
|
||||
import { errorMessages } from "@/constants/error-messages";
|
||||
import { getDamageString, isGlassAvailableForCarId } from "@/helpers/damage-helper";
|
||||
import { getDamageString, getIsWindshieldOnly, isGlassAvailableForCarId } from "@/helpers/damage-helper";
|
||||
import { required, regex } from "@/helpers/validation-rules";
|
||||
import { Form, defineRule } from "vee-validate";
|
||||
import { navigateAfterSaveToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
|
||||
|
|
@ -267,6 +268,13 @@ export default {
|
|||
return this.getCmsContent("PerfectMatchNewVinAlert", "BodyText").replaceAll("{custom:damage}",
|
||||
getDamageString())
|
||||
},
|
||||
PerfectMatchNewVinAlertReadOnlyHeader () {
|
||||
return this.getCmsContent("PerfectMatchNewVinAlertReadOnly", "HeadlineText");
|
||||
},
|
||||
PerfectMatchNewVinAlertReadOnlyBody () {
|
||||
return this.getCmsContent("PerfectMatchNewVinAlertReadOnly", "BodyText").replaceAll("{custom:damage}",
|
||||
getIsWindshieldOnly())
|
||||
},
|
||||
isVinFieldReadOnly(){
|
||||
return this.$store.getters.payment.insuranceCoverage.isVerified;
|
||||
},
|
||||
|
|
|
|||
|
|
@ -144,9 +144,9 @@ export const mutations = {
|
|||
updateRegistrationAddress(state, registrationAddress){
|
||||
state.order.vehicle.registration.address = registrationAddress;
|
||||
},
|
||||
updateServiceLocationZip(state, serviceLocationZip){
|
||||
updateServiceLocationZipCode(state, serviceLocationZip){
|
||||
state.order.vehicle.registration.zip = serviceLocationZip;
|
||||
},
|
||||
},
|
||||
updateRegistrationCity(state, serviceCity){
|
||||
state.order.vehicle.registration.city = serviceCity;
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue