SSR-1049 PR Changes
This commit is contained in:
parent
790c6a60f4
commit
0dfb25b886
3 changed files with 27 additions and 13 deletions
|
|
@ -135,10 +135,6 @@ import { formatAmountInDollars } from '@/helpers/text-helper.js';
|
|||
|
||||
const SAFELITE_PROVIDER = 'Safelite';
|
||||
|
||||
function setBailout(message) {
|
||||
useMainStore().setBailout(message);
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'coverage-statement',
|
||||
components: {
|
||||
|
|
@ -186,7 +182,7 @@ export default {
|
|||
await useMainStore().getFinalDeductible();
|
||||
pricingResults = await useMainStore().getPriceOrderItems(availableLineItems)
|
||||
.catch((err) => {
|
||||
setBailout(bailoutMessage.pricingResponseError(
|
||||
useMainStore().setBailout(bailoutMessage.pricingResponseError(
|
||||
availableLineItems.map((li) => li.partNumber),
|
||||
{ code: err.code, message: err.message, data: err.data }
|
||||
));
|
||||
|
|
@ -397,17 +393,14 @@ export default {
|
|||
useMainStore().updateSupportingItems(this.supportingItems);
|
||||
this.navigateWithScenario(navigationScenarios.CLICKED_FORWARD_WITH_SAFELITE);
|
||||
} else {
|
||||
this.setBailoutWithMessage(bailoutMessage.RequestCallback());
|
||||
useMainStore().setBailout(bailoutMessage.RequestCallback());
|
||||
this.navigateWithScenario(navigationScenarios.CLICKED_FORWARD_WITH_NON_SAFELITE_SHOP);
|
||||
}
|
||||
} else {
|
||||
this.setBailoutWithMessage(bailoutMessage.coverageStatementInvalidState());
|
||||
useMainStore().setBailout(bailoutMessage.coverageStatementInvalidState());
|
||||
this.navigateWithScenario(navigationScenarios.CLICKED_FORWARD_WITH_INVALID_STATE);
|
||||
}
|
||||
},
|
||||
setBailoutWithMessage(message) {
|
||||
setBailout(message);
|
||||
},
|
||||
navigateWithScenario(scenario) {
|
||||
this.$router.navigate(scenario, this.$route);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1574,10 +1574,13 @@ export const useMainStore = defineStore({
|
|||
this.order.vehicle.imageVifNumber = vehicle.imageVifNumber;
|
||||
this.order.vehicle.imageColor = vehicle.imageVifColor;
|
||||
|
||||
if (vehicle.canSafeliteService != null && !vehicle.canSafeliteService) {
|
||||
if (vehicle.canSafeliteService) {
|
||||
if (this.isBailout && this.bailoutCode === bailoutCode.HeavyTruckVehicle) {
|
||||
// reset previously set bailout if vehicle can be serviced.
|
||||
this.resetBailout();
|
||||
}
|
||||
} else {
|
||||
this.setBailout(bailoutMessage.HeavyTruckVehicle(vehicle.carId));
|
||||
} else if (this.isBailout && this.bailoutCode === bailoutCode.HeavyTruckVehicle) {
|
||||
this.resetBailout();
|
||||
}
|
||||
|
||||
// These could be undefined
|
||||
|
|
|
|||
|
|
@ -1066,6 +1066,12 @@ describe('Store', () => {
|
|||
it('sets expected vehicle data', async () => {
|
||||
// Arrange
|
||||
globalMethods.callHttpClient = jest.fn().mockReturnValue(Promise.resolve(fullApiResponse));
|
||||
store.lookupVehicleByVin = jest.fn().mockReturnValue(Promise.resolve({
|
||||
data: {
|
||||
vin: vehicle.vin,
|
||||
canSafeliteService: true
|
||||
}
|
||||
}));
|
||||
|
||||
const duplicate = {
|
||||
referralNumber: getRandomString(6, 6),
|
||||
|
|
@ -1089,6 +1095,12 @@ describe('Store', () => {
|
|||
it('sets expected customer data', async () => {
|
||||
// Arrange
|
||||
globalMethods.callHttpClient = jest.fn().mockReturnValue(Promise.resolve(fullApiResponse));
|
||||
store.lookupVehicleByVin = jest.fn().mockReturnValue(Promise.resolve({
|
||||
data: {
|
||||
vin: vehicle.vin,
|
||||
canSafeliteService: true
|
||||
}
|
||||
}));
|
||||
|
||||
const duplicate = {
|
||||
referralNumber: getRandomString(6, 6),
|
||||
|
|
@ -1115,6 +1127,12 @@ describe('Store', () => {
|
|||
it('sets expected remaining order data', async () => {
|
||||
// Arrange
|
||||
globalMethods.callHttpClient = jest.fn().mockReturnValue(Promise.resolve(fullApiResponse));
|
||||
store.lookupVehicleByVin = jest.fn().mockReturnValue(Promise.resolve({
|
||||
data: {
|
||||
vin: vehicle.vin,
|
||||
canSafeliteService: true
|
||||
}
|
||||
}));
|
||||
|
||||
const duplicate = {
|
||||
referralNumber: getRandomString(6, 6),
|
||||
|
|
|
|||
Loading…
Reference in a new issue