Merge pull request #1824 from Safelite/feature/CSR-2063

Feature/csr 2063
This commit is contained in:
CarlNation 2024-04-12 10:53:22 -04:00 committed by GitHub
commit a8ccf7e1c4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 29 additions and 20 deletions

View file

@ -718,18 +718,6 @@ describe("vehicle-damage.vue", () => {
);
});
describe("hide back button", () => {
test("if claim registration is delayed => should hide back button", () => {
// Arrange
const { wrapper } = setupMocks({
funnelCookie: {
HasDelayedClaimRegistration: true,
},
});
// Assert
expect(wrapper.vm.shouldHideBackButton).toBe(true);
});
test("if claim is verified => should hide back button", () => {
// Arrange
const { wrapper } = setupMocks({

View file

@ -530,10 +530,7 @@ export default {
return this.$route.params[this.routerParams.DISPLAY_VEHICLE_CHANGE_ALERT];
},
shouldHideBackButton() {
return (
this.$store.getters.payment.insuranceCoverage.isVerified ||
getFunnelCookie()?.HasDelayedClaimRegistration
);
return this.$store.getters.payment.insuranceCoverage.isVerified;
},
},

View file

@ -12,7 +12,7 @@
<vehicleQuestion
ref="vehicleYearQuestion"
v-model="selectedYear"
:isDisabled="!yearOptions.length"
:isDisabled="isYearDisabled"
:options="yearOptions"
cmsWidgetName="VehicleYearQuestion"
validationRules="year-required"
@ -22,7 +22,7 @@
<vehicleQuestion
ref="vehicleMakeQuestion"
v-model="selectedMake"
:isDisabled="!makeOptions.length"
:isDisabled="isMakeDisabled"
:options="makeOptions"
cmsWidgetName="VehicleMakeQuestion"
validationRules="make-required"
@ -33,7 +33,7 @@
ref="vehicleModelQuestion"
v-model="selectedModel"
cmsWidgetName="VehicleModelQuestion"
:isDisabled="!modelOptions.length"
:isDisabled="isModelDisabled"
:options="modelOptions"
validationRules="model-required"
placeHolderText="Select model"
@ -43,7 +43,7 @@
ref="vehicleStyleQuestion"
v-model="selectedStyle"
cmsWidgetName="VehicleStyleQuestion"
:isDisabled="!styleOptions.length"
:isDisabled="isStyleDisabled"
:options="styleOptions"
validationRules="style-required"
placeHolderText="Select style"
@ -97,6 +97,7 @@ import { errorMessages } from "@/constants/error-messages";
import store from "@/store";
import { storeActions } from "@/constants/store-actions.js";
import baseMixin from "@/mixins/base-mixin.js";
import { getFunnelCookie } from "@/helpers/heritage-integration/cookie-helper";
//define validation rules
defineRule("year-required", required(errorMessages.YEAR_REQUIRED));
@ -311,6 +312,18 @@ export default {
},
},
computed: {
isYearDisabled() {
return this.isDisabled(this.yearOptions);
},
isMakeDisabled() {
return this.isDisabled(this.makeOptions);
},
isModelDisabled() {
return this.isDisabled(this.modelOptions);
},
isStyleDisabled() {
return this.isDisabled(this.styleOptions);
},
unmatchedVehicleIcon() {
if (this.imageUrl == null && this.carId !== null) return true;
else return false;
@ -332,6 +345,17 @@ export default {
},
},
methods: {
isDisabled(options) {
if (
!options.length ||
store.getters.payment?.insuranceCoverage?.isVerified ||
getFunnelCookie()?.HasDelayedClaimRegistration
) {
return true;
} else {
return false;
}
},
getVehicle(year, make, model, style) {
return this.dispatchStoreActionWithLogging(
this.storeActions.GET_VEHICLE,