-
-
-
+
+
+
@@ -155,7 +160,7 @@ export default {
alertIncomplete: 'AlertIncompleteWidget',
alertRecalWarning: 'AlertRecalWarningWidget',
editShopLinkText: 'EditShopLinkTextWidget',
- contactDetails: 'ContactDetailsSectionWidget'
+ contactDetails: 'ContactDetailsSectionWidget'
},
modalPositions
};
@@ -269,7 +274,7 @@ export default {
bodyText: this.getCmsContent(widgetName, widgetFields.CONTENT_GROUP_WIDGET.BODY_TEXT),
footerButtonText: this.getCmsContent(widgetName, widgetFields.CONTENT_GROUP_WIDGET.FOOTER_TEXT),
image: this.getCmsContent(widgetName, widgetFields.CONTENT_GROUP_WIDGET.IMAGE)
- }
+ };
},
recalibrationRequired() {
return this.mainStore.hasRecalibrationPart;
@@ -281,9 +286,9 @@ export default {
}
return {
glassShop: this.getPreferredShopTitle,
- contactPhone: contactPhone,
+ contactPhone,
contactEmail: this.mainStore.contactInfo.emailAddress ?? ''
- }
+ };
}
},
methods: {
@@ -293,7 +298,7 @@ export default {
this.getPreferredShopTitle,
this.getPreferredShopLines,
this.getEditShopLinkText,
- () => this.navigate(this.navigationScenarios.EDIT_PREFERRED_SHOP),
+ () => this.navigate(this.navigationScenarios.EDIT_PREFERRED_SHOP)
),
// eslint-disable-next-line max-len
this.getSection(
@@ -306,7 +311,7 @@ export default {
},
getSection(title, lines, editLinkText, onClick) {
return {
- title: title,
+ title,
lines,
editLinkText,
onClickEdit: onClick
diff --git a/src/store/store.spec.js b/src/store/store.spec.js
index 239589ee..4a035c63 100644
--- a/src/store/store.spec.js
+++ b/src/store/store.spec.js
@@ -12,7 +12,6 @@ import coverageStatuses from '@/constants/coverage-statuses.js';
import { paymentMethods } from '@/constants/payment-method-constants';
import endpoints from '@/constants/endpoints';
import { AppointmentTypeStrings } from '@/constants/schedule-constants';
-import bailoutCode from '@/constants/bailoutCode';
import coverageType from '@/constants/coverage-type';
import { getEnumName } from '@/helpers/unit-test-helper';
@@ -227,6 +226,10 @@ describe('Store', () => {
test(`CoverageType is set to expected ${getEnumName(coverageType, expected)} when vehicle noCoverage is ${noCoverage} and enableNoCompQuote is ${enableNoCompQuote}`, () => {
// Arrange
store.issConfig.enableNoCompQuote = enableNoCompQuote;
+ store.order.currentDeductible = {
+ replace: 500,
+ repair: 0
+ };
const vehicleCoverage = {
noCoverage
};
@@ -407,6 +410,10 @@ describe('Store', () => {
}
};
store.order.insuranceCoverage.coverageType = coverageType.NO_COMP;
+ store.order.currentDeductible = {
+ replace: 500,
+ repair: 0
+ };
globalMethods.callHttpClient = jest.fn().mockReturnValue(Promise.resolve(response));
@@ -434,6 +441,10 @@ describe('Store', () => {
}
};
store.order.insuranceCoverage.coverageType = coverageType.Deductible;
+ store.order.currentDeductible = {
+ replace: 500,
+ repair: 0
+ };
globalMethods.callHttpClient = jest.fn().mockReturnValue(Promise.resolve(response));
@@ -453,6 +464,10 @@ describe('Store', () => {
const error = 'register claim error';
globalMethods.callHttpClient = jest.fn().mockReturnValue(Promise.reject(error));
store.order.insuranceCoverage.coverageStatus = coverageStatuses.PENDING;
+ store.order.currentDeductible = {
+ replace: 500,
+ repair: 0
+ };
// Act
await store.registerClaim().catch((e) => {
@@ -501,7 +516,7 @@ describe('Store', () => {
home: homePhone,
service: servicePhone,
alternative: altPhone,
- extension: extension
+ extension
});
// Assert
@@ -670,10 +685,22 @@ describe('Store', () => {
const policyZipCode = getRandomString(6, 6);
const status = getRandomEnum(coverageStatuses);
const type = getRandomEnum(coverageType);
- const originalDeductible = getRandomString(6, 6);
- const currentDeductible = getRandomString(6, 6);
- store.order.originalDeductible = originalDeductible;
- store.order.currentDeductible = currentDeductible;
+ const originalDeductible = {
+ replace: 500,
+ repair: 0
+ };
+ const currentDeductible = {
+ replace: 500,
+ repair: 0
+ };
+ store.order.originalDeductible = {
+ replace: originalDeductible.replace,
+ repair: originalDeductible.repair
+ };
+ store.order.currentDeductible = {
+ replace: currentDeductible.replace,
+ repair: currentDeductible.repair
+ };
store.order.customer.firstName = customerFirstName;
store.order.customer.lastName = customerLastName;
store.order.customer.emailAddress = customerEmail;
@@ -684,6 +711,7 @@ describe('Store', () => {
store.order.policy.policyZipCode = policyZipCode;
store.order.insuranceCoverage.coverageStatus = status;
store.order.insuranceCoverage.coverageType = type;
+ store.order.damage.isRepair = false;
globalMethods.callHttpClient = jest.fn().mockReturnValue(Promise.resolve({}));
// Act
@@ -702,8 +730,8 @@ describe('Store', () => {
}),
policyNumber,
policyZipCode,
- originalDeductible,
- currentDeductible
+ originalDeductible: originalDeductible.replace,
+ currentDeductible: currentDeductible.replace
}),
insuranceCoverage: expect.objectContaining({
coverageStatus: status,
@@ -1717,8 +1745,8 @@ describe('Store', () => {
const manualGlassNames = [location];
const policyState = getRandomString(2, 2);
const status = getRandomString(6, 8);
- const currentDeductible = getRandomInt(0, 5000);
- const originalDeductible = getRandomInt(0, 5000);
+ const currentDeductible = 500;
+ const originalDeductible = 500;
const isRepair = getRandomBoolean();
const policyNumber = getRandomString(10, 20);
const insuredFirstName = getRandomString(10, 20);
@@ -1730,8 +1758,14 @@ describe('Store', () => {
store.order.referralCorrelationId = referralCorrelationId;
store.order.parentAccountNumber = parentAccountNumber;
- store.order.currentDeductible = currentDeductible;
- store.order.originalDeductible = originalDeductible;
+ store.order.currentDeductible = {
+ replace: currentDeductible,
+ repair: currentDeductible
+ };
+ store.order.originalDeductible = {
+ replace: originalDeductible,
+ repair: originalDeductible
+ };
store.order.policy.status = status;
store.order.customer.address.state = policyState;
store.order.damage.isRepair = isRepair;
@@ -1827,8 +1861,14 @@ describe('Store', () => {
store.order.referralCorrelationId = referralCorrelationId;
store.order.parentAccountNumber = parentAccountNumber;
- store.order.currentDeductible = currentDeductible;
- store.order.originalDeductible = originalDeductible;
+ store.order.currentDeductible = {
+ replace: currentDeductible,
+ repair: currentDeductible
+ };
+ store.order.originalDeductible = {
+ replace: originalDeductible,
+ repair: originalDeductible
+ };
store.order.policy.status = status;
store.order.customer.address.state = policyState;
store.order.policy.endorsementQuestionAnswers = endorsementAnswers;
@@ -1898,23 +1938,29 @@ describe('Store', () => {
describe('updateDeductible method', () => {
it('final deductible is saved as currentDeductible in store', () => {
// Arrange
- const finalDeductible = getRandomInt(0, 5000);
+ store.order.damage.isRepair = false;
+ const deductibleInfo = {
+ deductible: 500
+ };
// Act
- store.updateDeductible(finalDeductible);
+ store.updateDeductible(deductibleInfo);
// Assert
- expect(store.order.currentDeductible).toEqual(finalDeductible);
+ expect(store.order.currentDeductible.replace).toEqual(deductibleInfo.deductible);
});
it('null final deductible => currentDeductible in store set to null', () => {
// Arrange
- const finalDeductible = null;
+ store.order.damage.isRepair = false;
+ const deductibleInfo = {
+ deductible: null
+ };
// Act
- store.updateDeductible(finalDeductible);
+ store.updateDeductible(deductibleInfo);
// Assert
- expect(store.order.currentDeductible).toEqual(finalDeductible);
+ expect(store.order.currentDeductible.replace).toEqual(deductibleInfo.deductible);
});
});