Merge pull request #1824 from Safelite/feature/CSR-2063
Feature/csr 2063
This commit is contained in:
commit
a8ccf7e1c4
3 changed files with 29 additions and 20 deletions
|
|
@ -718,18 +718,6 @@ describe("vehicle-damage.vue", () => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
describe("hide back button", () => {
|
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", () => {
|
test("if claim is verified => should hide back button", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const { wrapper } = setupMocks({
|
const { wrapper } = setupMocks({
|
||||||
|
|
|
||||||
|
|
@ -530,10 +530,7 @@ export default {
|
||||||
return this.$route.params[this.routerParams.DISPLAY_VEHICLE_CHANGE_ALERT];
|
return this.$route.params[this.routerParams.DISPLAY_VEHICLE_CHANGE_ALERT];
|
||||||
},
|
},
|
||||||
shouldHideBackButton() {
|
shouldHideBackButton() {
|
||||||
return (
|
return this.$store.getters.payment.insuranceCoverage.isVerified;
|
||||||
this.$store.getters.payment.insuranceCoverage.isVerified ||
|
|
||||||
getFunnelCookie()?.HasDelayedClaimRegistration
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
<vehicleQuestion
|
<vehicleQuestion
|
||||||
ref="vehicleYearQuestion"
|
ref="vehicleYearQuestion"
|
||||||
v-model="selectedYear"
|
v-model="selectedYear"
|
||||||
:isDisabled="!yearOptions.length"
|
:isDisabled="isYearDisabled"
|
||||||
:options="yearOptions"
|
:options="yearOptions"
|
||||||
cmsWidgetName="VehicleYearQuestion"
|
cmsWidgetName="VehicleYearQuestion"
|
||||||
validationRules="year-required"
|
validationRules="year-required"
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
<vehicleQuestion
|
<vehicleQuestion
|
||||||
ref="vehicleMakeQuestion"
|
ref="vehicleMakeQuestion"
|
||||||
v-model="selectedMake"
|
v-model="selectedMake"
|
||||||
:isDisabled="!makeOptions.length"
|
:isDisabled="isMakeDisabled"
|
||||||
:options="makeOptions"
|
:options="makeOptions"
|
||||||
cmsWidgetName="VehicleMakeQuestion"
|
cmsWidgetName="VehicleMakeQuestion"
|
||||||
validationRules="make-required"
|
validationRules="make-required"
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
ref="vehicleModelQuestion"
|
ref="vehicleModelQuestion"
|
||||||
v-model="selectedModel"
|
v-model="selectedModel"
|
||||||
cmsWidgetName="VehicleModelQuestion"
|
cmsWidgetName="VehicleModelQuestion"
|
||||||
:isDisabled="!modelOptions.length"
|
:isDisabled="isModelDisabled"
|
||||||
:options="modelOptions"
|
:options="modelOptions"
|
||||||
validationRules="model-required"
|
validationRules="model-required"
|
||||||
placeHolderText="Select model"
|
placeHolderText="Select model"
|
||||||
|
|
@ -43,7 +43,7 @@
|
||||||
ref="vehicleStyleQuestion"
|
ref="vehicleStyleQuestion"
|
||||||
v-model="selectedStyle"
|
v-model="selectedStyle"
|
||||||
cmsWidgetName="VehicleStyleQuestion"
|
cmsWidgetName="VehicleStyleQuestion"
|
||||||
:isDisabled="!styleOptions.length"
|
:isDisabled="isStyleDisabled"
|
||||||
:options="styleOptions"
|
:options="styleOptions"
|
||||||
validationRules="style-required"
|
validationRules="style-required"
|
||||||
placeHolderText="Select style"
|
placeHolderText="Select style"
|
||||||
|
|
@ -97,6 +97,7 @@ import { errorMessages } from "@/constants/error-messages";
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
import { storeActions } from "@/constants/store-actions.js";
|
import { storeActions } from "@/constants/store-actions.js";
|
||||||
import baseMixin from "@/mixins/base-mixin.js";
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
|
import { getFunnelCookie } from "@/helpers/heritage-integration/cookie-helper";
|
||||||
|
|
||||||
//define validation rules
|
//define validation rules
|
||||||
defineRule("year-required", required(errorMessages.YEAR_REQUIRED));
|
defineRule("year-required", required(errorMessages.YEAR_REQUIRED));
|
||||||
|
|
@ -311,6 +312,18 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
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() {
|
unmatchedVehicleIcon() {
|
||||||
if (this.imageUrl == null && this.carId !== null) return true;
|
if (this.imageUrl == null && this.carId !== null) return true;
|
||||||
else return false;
|
else return false;
|
||||||
|
|
@ -332,6 +345,17 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
isDisabled(options) {
|
||||||
|
if (
|
||||||
|
!options.length ||
|
||||||
|
store.getters.payment?.insuranceCoverage?.isVerified ||
|
||||||
|
getFunnelCookie()?.HasDelayedClaimRegistration
|
||||||
|
) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},
|
||||||
getVehicle(year, make, model, style) {
|
getVehicle(year, make, model, style) {
|
||||||
return this.dispatchStoreActionWithLogging(
|
return this.dispatchStoreActionWithLogging(
|
||||||
this.storeActions.GET_VEHICLE,
|
this.storeActions.GET_VEHICLE,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue