Merge pull request #1014 from Safelite/feature/kiener/INSR-7753
INSR-7753: Coverage Statement page
This commit is contained in:
commit
6d5b4b906e
15 changed files with 440 additions and 291 deletions
|
|
@ -66,7 +66,7 @@ const bailoutMessage = Object.freeze({
|
||||||
message: 'User selected to continue a referral where a TPA shop was previously selected.'
|
message: 'User selected to continue a referral where a TPA shop was previously selected.'
|
||||||
}),
|
}),
|
||||||
vehicleYMMSLookupError: (year, make, model, style, error) => {
|
vehicleYMMSLookupError: (year, make, model, style, error) => {
|
||||||
const baseMessage = "An error occurred looking up vehicle";
|
const baseMessage = 'An error occurred looking up vehicle';
|
||||||
const errorMessage = `Error: ${getItemData(error)}`;
|
const errorMessage = `Error: ${getItemData(error)}`;
|
||||||
|
|
||||||
const getMessage = (year, make, model, style) => {
|
const getMessage = (year, make, model, style) => {
|
||||||
|
|
@ -81,7 +81,7 @@ const bailoutMessage = Object.freeze({
|
||||||
code: bailoutCode.VehicleYMMSLookupError,
|
code: bailoutCode.VehicleYMMSLookupError,
|
||||||
message: getMessage(year, make, model, style)
|
message: getMessage(year, make, model, style)
|
||||||
};
|
};
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default bailoutMessage;
|
export default bailoutMessage;
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ export function getMobileFeeLineItem(order) {
|
||||||
* @returns {number|undefined|null} current deductible
|
* @returns {number|undefined|null} current deductible
|
||||||
*/
|
*/
|
||||||
export function getDeductible(order) {
|
export function getDeductible(order) {
|
||||||
return order.currentDeductible;
|
return order.damage.isRepair ? order.currentDeductible.repair : order.currentDeductible.replace;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -239,8 +239,13 @@ describe('cart-helper', () => {
|
||||||
describe('getDeductible', () => {
|
describe('getDeductible', () => {
|
||||||
test('Returns deductible on the order', () => {
|
test('Returns deductible on the order', () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const deductible = 100;
|
const deductible = {
|
||||||
|
replace: 100
|
||||||
|
};
|
||||||
const order = {
|
const order = {
|
||||||
|
damage: {
|
||||||
|
isRepair: false
|
||||||
|
},
|
||||||
currentDeductible: deductible
|
currentDeductible: deductible
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -249,7 +254,7 @@ describe('cart-helper', () => {
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(result).not.toBeNull();
|
expect(result).not.toBeNull();
|
||||||
expect(result).toBe(deductible);
|
expect(result).toBe(deductible.replace);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -349,7 +354,12 @@ describe('cart-helper', () => {
|
||||||
coverageStatus: coverageStatuses.VERIFIED,
|
coverageStatus: coverageStatuses.VERIFIED,
|
||||||
coverageType: type
|
coverageType: type
|
||||||
},
|
},
|
||||||
currentDeductible: 100,
|
damage: {
|
||||||
|
isRepair: false
|
||||||
|
},
|
||||||
|
currentDeductible: {
|
||||||
|
replace: 100
|
||||||
|
},
|
||||||
lineItems: nullLineItems
|
lineItems: nullLineItems
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -373,7 +383,12 @@ describe('cart-helper', () => {
|
||||||
coverageStatus: coverageStatuses.VERIFIED,
|
coverageStatus: coverageStatuses.VERIFIED,
|
||||||
coverageType: type
|
coverageType: type
|
||||||
},
|
},
|
||||||
currentDeductible: 100,
|
damage: {
|
||||||
|
isRepair: false
|
||||||
|
},
|
||||||
|
currentDeductible: {
|
||||||
|
replace: 100
|
||||||
|
},
|
||||||
lineItems: emptyLineItems
|
lineItems: emptyLineItems
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -397,7 +412,12 @@ describe('cart-helper', () => {
|
||||||
coverageStatus: coverageStatuses.VERIFIED,
|
coverageStatus: coverageStatuses.VERIFIED,
|
||||||
coverageType: type
|
coverageType: type
|
||||||
},
|
},
|
||||||
currentDeductible: 100,
|
damage: {
|
||||||
|
isRepair: false
|
||||||
|
},
|
||||||
|
currentDeductible: {
|
||||||
|
replace: 100
|
||||||
|
},
|
||||||
lineItems: defaultLineItems
|
lineItems: defaultLineItems
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -495,7 +515,12 @@ describe('cart-helper', () => {
|
||||||
coverageStatus: coverageStatuses.VERIFIED,
|
coverageStatus: coverageStatuses.VERIFIED,
|
||||||
coverageType: type
|
coverageType: type
|
||||||
},
|
},
|
||||||
currentDeductible: 100,
|
damage: {
|
||||||
|
isRepair: false
|
||||||
|
},
|
||||||
|
currentDeductible: {
|
||||||
|
replace: 100
|
||||||
|
},
|
||||||
lineItems: nullLineItems
|
lineItems: nullLineItems
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -520,7 +545,12 @@ describe('cart-helper', () => {
|
||||||
coverageStatus: coverageStatuses.VERIFIED,
|
coverageStatus: coverageStatuses.VERIFIED,
|
||||||
coverageType: type
|
coverageType: type
|
||||||
},
|
},
|
||||||
currentDeductible: 100,
|
damage: {
|
||||||
|
isRepair: false
|
||||||
|
},
|
||||||
|
currentDeductible: {
|
||||||
|
replace: 100
|
||||||
|
},
|
||||||
lineItems: emptyLineItems
|
lineItems: emptyLineItems
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -545,7 +575,12 @@ describe('cart-helper', () => {
|
||||||
coverageStatus: coverageStatuses.VERIFIED,
|
coverageStatus: coverageStatuses.VERIFIED,
|
||||||
coverageType: type
|
coverageType: type
|
||||||
},
|
},
|
||||||
currentDeductible: 100,
|
damage: {
|
||||||
|
isRepair: false
|
||||||
|
},
|
||||||
|
currentDeductible: {
|
||||||
|
replace: 100
|
||||||
|
},
|
||||||
lineItems: defaultLineItems
|
lineItems: defaultLineItems
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,17 @@ export function createOrderedListFromStringOfParagraphs(stringOfParagraphs) {
|
||||||
return `<ol>${stringOfParagraphs.replaceAll('<p></p>', '').replaceAll('<p>', '<li>').replaceAll('</p>', '</li>')}</ol>`;
|
return `<ol>${stringOfParagraphs.replaceAll('<p></p>', '').replaceAll('<p>', '<li>').replaceAll('</p>', '</li>')}</ol>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @function createUnorderedListFromStringOfParagraphs
|
||||||
|
* @summary
|
||||||
|
* Returns string with <p> tags changed to <li> and wrapped in an <ul>
|
||||||
|
* @param {string} stringOfParagraphs single string with 1 to N <p> tags
|
||||||
|
* @returns {string} converted string wrapped in an <ul>
|
||||||
|
*/
|
||||||
|
export function createUnorderedListFromStringOfParagraphs(stringOfParagraphs) {
|
||||||
|
return `<ul>${stringOfParagraphs.replaceAll('<p></p>', '').replaceAll('<p>', '<li>').replaceAll('</p>', '</li>')}</ul>`;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @function toTitleCase
|
* @function toTitleCase
|
||||||
* @summary Returns title cased string version of 'text'
|
* @summary Returns title cased string version of 'text'
|
||||||
|
|
|
||||||
|
|
@ -2,23 +2,13 @@
|
||||||
|
|
||||||
exports[`coverageStatement.vue returns the initial data 1`] = `
|
exports[`coverageStatement.vue returns the initial data 1`] = `
|
||||||
Object {
|
Object {
|
||||||
"CANCEL_CLAIM_REF_NAME": "CancelClaimModal",
|
|
||||||
"DEDUCTIBLE_MODAL_REF_NAME": "DeductibleModal",
|
|
||||||
"RECAL_MODAL_REF_NAME": "RecalModal",
|
"RECAL_MODAL_REF_NAME": "RecalModal",
|
||||||
"SITE_FOOTER_REF_NAME": "siteFooter",
|
|
||||||
"baseServiceLineItems": Array [],
|
"baseServiceLineItems": Array [],
|
||||||
"deductibleText": "Your deductible is",
|
|
||||||
"rules": Object {
|
|
||||||
"selectionRequired": "option-required",
|
|
||||||
},
|
|
||||||
"selectedProvider": "",
|
|
||||||
"widget": Object {
|
"widget": Object {
|
||||||
"disclaimerText": "DisclaimerWidget",
|
"disclaimerText": "DisclaimerWidget",
|
||||||
"explanatoryText": "ExplanatoryTextWidget",
|
"explanatoryText": "ExplanatoryTextWidget",
|
||||||
"nextStep": "NextStepsWidget",
|
"nextStep": "NextStepsWidget",
|
||||||
"serviceProviderQuestion": "ServiceProviderQuestion",
|
|
||||||
"subheader": "SiteSubHeaderWidget",
|
"subheader": "SiteSubHeaderWidget",
|
||||||
"verifiedItacAlert": "VerifiedITACAlert",
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ jest.mock('@/helpers/cms-content-helper', () => ({
|
||||||
|
|
||||||
jest.mock('@/helpers/text-helper', () => ({
|
jest.mock('@/helpers/text-helper', () => ({
|
||||||
createOrderedListFromStringOfParagraphs: jest.fn(),
|
createOrderedListFromStringOfParagraphs: jest.fn(),
|
||||||
|
createUnorderedListFromStringOfParagraphs: jest.fn(),
|
||||||
formatAmountInDollars: jest.fn()
|
formatAmountInDollars: jest.fn()
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
@ -98,9 +99,6 @@ function getMountedComponent(mainInitialState = {}, initialData = {}, methodToRu
|
||||||
fetchCmsContentForPage.mockImplementation(() => Promise.resolve());
|
fetchCmsContentForPage.mockImplementation(() => Promise.resolve());
|
||||||
|
|
||||||
const wrapper = shallowMount(coverageStatement, mountOptions);
|
const wrapper = shallowMount(coverageStatement, mountOptions);
|
||||||
wrapper.vm.$refs[CANCEL_CLAIM_REF_NAME].openModal = jest.fn();
|
|
||||||
wrapper.vm.$refs.siteFooter.disableForwardButton = jest.fn();
|
|
||||||
wrapper.vm.$refs.siteFooter.enableForwardAction = jest.fn();
|
|
||||||
return { wrapper };
|
return { wrapper };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -165,16 +163,6 @@ describe('coverageStatement.vue', () => {
|
||||||
// Assert
|
// Assert
|
||||||
expect(secondaryText.exists()).toBe(true);
|
expect(secondaryText.exists()).toBe(true);
|
||||||
});
|
});
|
||||||
test('Should render site footer', () => {
|
|
||||||
// Arrange
|
|
||||||
const { wrapper } = getMountedComponent({});
|
|
||||||
|
|
||||||
// Act
|
|
||||||
const footer = wrapper.findComponent({ ref: 'siteFooter' });
|
|
||||||
|
|
||||||
// Assert
|
|
||||||
expect(footer.exists()).toBe(true);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
describe('Computed', () => {
|
describe('Computed', () => {
|
||||||
describe.each([
|
describe.each([
|
||||||
|
|
@ -373,7 +361,7 @@ describe('coverageStatement.vue', () => {
|
||||||
[false, coverageStatuses.PENDING, coverageType.NO_COMP],
|
[false, coverageStatuses.PENDING, coverageType.NO_COMP],
|
||||||
[false, coverageStatuses.PENDING, coverageType.Deductible],
|
[false, coverageStatuses.PENDING, coverageType.Deductible],
|
||||||
[true, coverageStatuses.VERIFIED, coverageType.NO_COMP],
|
[true, coverageStatuses.VERIFIED, coverageType.NO_COMP],
|
||||||
[true, coverageStatuses.VERIFIED, coverageType.ITAC],
|
[false, coverageStatuses.VERIFIED, coverageType.ITAC],
|
||||||
[false, coverageStatuses.VERIFIED, coverageType.Deductible],
|
[false, coverageStatuses.VERIFIED, coverageType.Deductible],
|
||||||
[false, coverageStatuses.NO_COVERAGE, coverageType.NO_COMP],
|
[false, coverageStatuses.NO_COVERAGE, coverageType.NO_COMP],
|
||||||
[false, coverageStatuses.NO_COVERAGE, coverageType.ITAC],
|
[false, coverageStatuses.NO_COVERAGE, coverageType.ITAC],
|
||||||
|
|
@ -512,7 +500,10 @@ describe('coverageStatement.vue', () => {
|
||||||
coverageStatus: coverageStatuses.PENDING,
|
coverageStatus: coverageStatuses.PENDING,
|
||||||
coverageType: coverageType.NONE
|
coverageType: coverageType.NONE
|
||||||
},
|
},
|
||||||
currentDeductible: null
|
currentDeductible: {
|
||||||
|
repair: null,
|
||||||
|
replace: null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const { wrapper } = getMountedComponent(mainInitialState);
|
const { wrapper } = getMountedComponent(mainInitialState);
|
||||||
|
|
@ -539,7 +530,9 @@ describe('coverageStatement.vue', () => {
|
||||||
coverageStatus: coverageStatuses.VERIFIED,
|
coverageStatus: coverageStatuses.VERIFIED,
|
||||||
coverageType: coverageType.Deductible
|
coverageType: coverageType.Deductible
|
||||||
},
|
},
|
||||||
currentDeductible: deductible
|
currentDeductible: {
|
||||||
|
replace: deductible
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const { wrapper } = getMountedComponent(mainInitialState);
|
const { wrapper } = getMountedComponent(mainInitialState);
|
||||||
|
|
@ -566,7 +559,9 @@ describe('coverageStatement.vue', () => {
|
||||||
coverageStatus: coverageStatuses.VERIFIED,
|
coverageStatus: coverageStatuses.VERIFIED,
|
||||||
coverageType: coverageType.ITAC
|
coverageType: coverageType.ITAC
|
||||||
},
|
},
|
||||||
currentDeductible: deductible
|
currentDeductible: {
|
||||||
|
replace: deductible
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const { wrapper } = getMountedComponent(mainInitialState);
|
const { wrapper } = getMountedComponent(mainInitialState);
|
||||||
|
|
@ -584,7 +579,7 @@ describe('coverageStatement.vue', () => {
|
||||||
undefined
|
undefined
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
test('If Verified ITAC, selected other shop, navigate forward w/ CLICKED_FORWARD_WITH_NON_SAFELITE_SHOP', () => {
|
test('If Verified ITAC, selected Cancel, navigate forward w/ CLICKED_FORWARD_WITH_NON_SAFELITE_SHOP', () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const deductible = servicePrice + 1;
|
const deductible = servicePrice + 1;
|
||||||
const mainInitialState = {
|
const mainInitialState = {
|
||||||
|
|
@ -596,7 +591,9 @@ describe('coverageStatement.vue', () => {
|
||||||
coverageStatus: coverageStatuses.VERIFIED,
|
coverageStatus: coverageStatuses.VERIFIED,
|
||||||
coverageType: coverageType.ITAC
|
coverageType: coverageType.ITAC
|
||||||
},
|
},
|
||||||
currentDeductible: deductible
|
currentDeductible: {
|
||||||
|
replace: deductible
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const { wrapper } = getMountedComponent(mainInitialState);
|
const { wrapper } = getMountedComponent(mainInitialState);
|
||||||
|
|
@ -605,7 +602,7 @@ describe('coverageStatement.vue', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
wrapper.vm.navigateForward();
|
wrapper.vm.cancelClaim();
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(wrapper.vm.$router.navigate)
|
expect(wrapper.vm.$router.navigate)
|
||||||
|
|
@ -667,7 +664,7 @@ describe('coverageStatement.vue', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
wrapper.vm.navigateForward();
|
wrapper.vm.cancelClaim();
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(wrapper.vm.$router.navigate)
|
expect(wrapper.vm.$router.navigate)
|
||||||
|
|
@ -776,7 +773,9 @@ describe('coverageStatement.vue', () => {
|
||||||
vehicle: {
|
vehicle: {
|
||||||
policyVehicleId: 1
|
policyVehicleId: 1
|
||||||
},
|
},
|
||||||
currentDeductible: deductible
|
currentDeductible: {
|
||||||
|
replace: deductible
|
||||||
|
}
|
||||||
},
|
},
|
||||||
issConfig: {
|
issConfig: {
|
||||||
isClaimRegistrationRequired: true
|
isClaimRegistrationRequired: true
|
||||||
|
|
|
||||||
|
|
@ -15,72 +15,87 @@
|
||||||
<div class="coverage-statement-container iss-heritage-content-container-width">
|
<div class="coverage-statement-container iss-heritage-content-container-width">
|
||||||
<h5
|
<h5
|
||||||
ref="siteSubHeader"
|
ref="siteSubHeader"
|
||||||
class="sub-header text-black mt-4"
|
class="sub-header text-black"
|
||||||
v-html="coverageStatementSubHeader"></h5>
|
v-html="coverageStatementSubHeader"></h5>
|
||||||
<div
|
<div
|
||||||
ref="explanatoryText"
|
ref="explanatoryText"
|
||||||
class="body-text mt-2"
|
class="body-text"
|
||||||
v-html="explanatoryText"></div>
|
v-html="explanatoryText"></div>
|
||||||
|
<div
|
||||||
|
ref="explanatoryText2"
|
||||||
|
class="body-text mt-3"
|
||||||
|
v-html="explanatoryText2"></div>
|
||||||
<div
|
<div
|
||||||
ref="secondaryText"
|
ref="secondaryText"
|
||||||
class="mt-4 mb-1 fw-bold text-black"
|
class="mt-4 mb-1 fw-bold text-black"
|
||||||
v-html="secondaryText"></div>
|
v-html="secondaryText"></div>
|
||||||
<div
|
<div
|
||||||
v-if="isDeductibleVisible"
|
v-if="isITACQuoteVisible"
|
||||||
class="d-flex justify-content-center cost">
|
class="itac-price-container">
|
||||||
|
<div class="itac-deductible-value-container">
|
||||||
|
<div class="itac-deductible-value-text">
|
||||||
|
Your deductible:
|
||||||
|
</div>
|
||||||
|
<div class="itac-deductible-value">
|
||||||
|
{{ formatAmountInDollars(deductibleValue) }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="separator"></div>
|
||||||
|
<div class="itac-cost-container">
|
||||||
|
<div class="itac-cost-text">
|
||||||
|
Safelite price*:
|
||||||
|
</div>
|
||||||
|
<div class="cost">
|
||||||
|
{{ formatAmountInDollars(totalServicePrice) }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-if="showDeductibleOnly"
|
||||||
|
class="d-flex cost cost-underline">
|
||||||
{{ formatAmountInDollars(deductibleValue) }}
|
{{ formatAmountInDollars(deductibleValue) }}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="isQuoteDisplayed"
|
class="fw-bold text-black mt-5"
|
||||||
class="d-flex justify-content-center cost mb-0">
|
|
||||||
{{ formatAmountInDollars(totalServicePrice) }}
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
v-if="isITACQuoteVisible"
|
|
||||||
class="d-flex justify-content-center mb-4 deductible-text">
|
|
||||||
{{ deductibleText }}
|
|
||||||
<span class="text-success fw-bold">{{
|
|
||||||
formatAmountInDollars(deductibleValue)
|
|
||||||
}}</span>
|
|
||||||
</div>
|
|
||||||
<alert
|
|
||||||
v-if="isITACQuoteVisible"
|
|
||||||
ref="verifiedITACAlert"
|
|
||||||
class="mb-5"
|
|
||||||
cmsWidgetName="VerifiedITACAlert"
|
|
||||||
:manualHeadline="verifiedItacAlertHeader"
|
|
||||||
:manualCopy="verifiedItacAlertBody"
|
|
||||||
alertClass="alert-success"
|
|
||||||
:isDismissible="false">
|
|
||||||
</alert>
|
|
||||||
<div
|
|
||||||
class="fw-bold text-black mt-5 mb-2"
|
|
||||||
v-html="nextStepsHeader"></div>
|
v-html="nextStepsHeader"></div>
|
||||||
<div
|
<div
|
||||||
class="body-text"
|
class="body-text"
|
||||||
v-html="nextStepsBody"></div>
|
v-html="nextStepsBody"></div>
|
||||||
<buttonQuestion
|
<div
|
||||||
|
v-if="isNoCompQuoteVisible"
|
||||||
|
class="no-comp-price-text">
|
||||||
|
Safelite price*:
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
v-if="isQuoteDisplayed"
|
v-if="isQuoteDisplayed"
|
||||||
v-model="selectedProvider"
|
class="d-flex justify-content-center cost mb-0 cost-underline">
|
||||||
cmsWidgetName="ServiceProviderQuestion"
|
{{ formatAmountInDollars(totalServicePrice) }}
|
||||||
:questionText="serviceProviderQuestionText"
|
</div>
|
||||||
:answers="serviceProviderQuestionAnswers"
|
<buttonMain
|
||||||
groupName="ServiceProviderQuestionOption"
|
ref="buttonMain"
|
||||||
buttonTypeString="listButton"
|
class="full-width-button mt-5 mb-5"
|
||||||
isRequired
|
variant="navigation"
|
||||||
:validationRules="rules.selectionRequired">
|
:buttonText="buttonText"
|
||||||
</buttonQuestion>
|
@clickEvent="navigateForward" />
|
||||||
<siteFooter
|
<textLink
|
||||||
:ref="SITE_FOOTER_REF_NAME"
|
v-if="isNoCompQuoteVisible || isITACQuoteVisible"
|
||||||
class="mt-5"
|
class="underlined-text cancel-link mt-5"
|
||||||
cmsWidgetName="SiteFooterWidget"
|
linkType="text"
|
||||||
:isForwardActionDisabled="!meta.valid"
|
text="No, I want to cancel"
|
||||||
@backClicked="navigateBackByVehicleQuestions"
|
href="#"
|
||||||
@forwardClicked="navigateForward" />
|
@clickEvent="cancelClaim" />
|
||||||
<textBlock
|
<textBlock
|
||||||
v-if="isQuoteDisplayed"
|
v-if="isDisclaimerVisible"
|
||||||
|
class="mt-5 mb-5"
|
||||||
:customText="disclaimerText"
|
:customText="disclaimerText"
|
||||||
typeStyle="caption" />
|
typeStyle="caption" />
|
||||||
|
<div :class="getVariant + ' mb-5'">
|
||||||
|
<textLink
|
||||||
|
linkType="navigation"
|
||||||
|
text="Back"
|
||||||
|
href="#"
|
||||||
|
@clickEvent="navigateBackByVehicleQuestions" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -88,28 +103,17 @@
|
||||||
:ref="RECAL_MODAL_REF_NAME"
|
:ref="RECAL_MODAL_REF_NAME"
|
||||||
cssModalHeadlineClass="text-center"
|
cssModalHeadlineClass="text-center"
|
||||||
cmsWidgetName="RecalModal" />
|
cmsWidgetName="RecalModal" />
|
||||||
<contentGroupModal
|
|
||||||
:ref="DEDUCTIBLE_MODAL_REF_NAME"
|
|
||||||
cmsWidgetName="DeductibleModal"
|
|
||||||
class="deductible-modal" />
|
|
||||||
<cancelClaimModal
|
|
||||||
:ref="CANCEL_CLAIM_REF_NAME"
|
|
||||||
@cancelClaimConfirmation="cancelClaim"
|
|
||||||
@returnToClaim="continueClaim" />
|
|
||||||
</Form>
|
</Form>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Import Component
|
// Import Component
|
||||||
import { Form } from 'vee-validate';
|
import { Form } from 'vee-validate';
|
||||||
import siteFooter from '@/iss-components/site-footer/site-footer.vue';
|
|
||||||
import siteHeader from '@/iss-components/site-header/site-header.vue';
|
import siteHeader from '@/iss-components/site-header/site-header.vue';
|
||||||
import alert from '@/ux-components/alert/alert.vue';
|
|
||||||
import cancelClaimModal from '@/layouts/coverage-statement/cancel-claim-modal/cancel-claim-modal.vue';
|
|
||||||
import contentGroupModal from '@/iss-components/content-group-modal/content-group-modal.vue';
|
import contentGroupModal from '@/iss-components/content-group-modal/content-group-modal.vue';
|
||||||
import buttonQuestion from '@/digital-components/button-question/button-question.vue';
|
|
||||||
import textBlock from '@/digital-components/text-block/text-block.vue';
|
import textBlock from '@/digital-components/text-block/text-block.vue';
|
||||||
|
import textLink from '@/ux-components/text-link/text-link.vue';
|
||||||
|
import buttonMain from '@/ux-components/button-main/button-main.vue';
|
||||||
// Import Supporting Files
|
// Import Supporting Files
|
||||||
import {
|
import {
|
||||||
fetchCmsContentForPage,
|
fetchCmsContentForPage,
|
||||||
|
|
@ -121,35 +125,28 @@ import settleAllPromises from '@/helpers/layout-helper.js';
|
||||||
import { getDamageString } from '@/helpers/damage-helper.js';
|
import { getDamageString } from '@/helpers/damage-helper.js';
|
||||||
import { useMainStore } from '@/store/index.js';
|
import { useMainStore } from '@/store/index.js';
|
||||||
import vehicleQuestionsMixin from '@/mixins/vehicle-questions-mixin.js';
|
import vehicleQuestionsMixin from '@/mixins/vehicle-questions-mixin.js';
|
||||||
import globalRules from '@/constants/global-rules.js';
|
|
||||||
import baseFormMixin from '@/mixins/base-form-mixin.js';
|
import baseFormMixin from '@/mixins/base-form-mixin.js';
|
||||||
import navigationScenarios from '@/router/router-constants/navigation-scenarios.js';
|
import navigationScenarios from '@/router/router-constants/navigation-scenarios.js';
|
||||||
import bailoutMessage from '@/constants/bailoutMessage';
|
import bailoutMessage from '@/constants/bailoutMessage';
|
||||||
import widgetFields from '@/constants/cms-widget-fields.js';
|
import widgetFields from '@/constants/cms-widget-fields.js';
|
||||||
import { formatAmountInDollars, createOrderedListFromStringOfParagraphs } from '@/helpers/text-helper.js';
|
import { formatAmountInDollars, createUnorderedListFromStringOfParagraphs, createOrderedListFromStringOfParagraphs } from '@/helpers/text-helper.js';
|
||||||
import showIssLoadingModal from '@/helpers/loading-modal-helper';
|
import showIssLoadingModal from '@/helpers/loading-modal-helper';
|
||||||
import { getPriceOfLineItems } from '@/helpers/price-calculator';
|
import { getPriceOfLineItems } from '@/helpers/price-calculator';
|
||||||
import coverageStatuses from '@/constants/coverage-statuses';
|
import coverageStatuses from '@/constants/coverage-statuses';
|
||||||
import coverageType from '@/constants/coverage-type';
|
import coverageType from '@/constants/coverage-type';
|
||||||
|
|
||||||
const CANCEL_CLAIM_REF_NAME = 'CancelClaimModal';
|
|
||||||
const SAFELITE_PROVIDER = 'Safelite';
|
|
||||||
const RECAL_MODAL_REF_NAME = 'RecalModal';
|
const RECAL_MODAL_REF_NAME = 'RecalModal';
|
||||||
const DEDUCTIBLE_MODAL_REF_NAME = 'DeductibleModal';
|
|
||||||
const SITE_FOOTER_REF_NAME = 'siteFooter';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'coverage-statement',
|
name: 'coverage-statement',
|
||||||
components: {
|
components: {
|
||||||
siteFooter,
|
|
||||||
siteHeader,
|
siteHeader,
|
||||||
// eslint-disable-next-line vue/no-reserved-component-names
|
// eslint-disable-next-line vue/no-reserved-component-names
|
||||||
Form,
|
Form,
|
||||||
alert,
|
|
||||||
cancelClaimModal,
|
|
||||||
contentGroupModal,
|
contentGroupModal,
|
||||||
buttonQuestion,
|
buttonMain,
|
||||||
textBlock
|
textBlock,
|
||||||
|
textLink
|
||||||
},
|
},
|
||||||
mixins: [baseFormMixin, vehicleQuestionsMixin],
|
mixins: [baseFormMixin, vehicleQuestionsMixin],
|
||||||
async beforeRouteEnter(to, from, next) {
|
async beforeRouteEnter(to, from, next) {
|
||||||
|
|
@ -204,24 +201,13 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
baseServiceLineItems: [],
|
baseServiceLineItems: [],
|
||||||
selectedProvider: '',
|
|
||||||
deductibleText: 'Your deductible is',
|
|
||||||
// TODO update when design team gives appropriate text
|
|
||||||
rules: {
|
|
||||||
selectionRequired: globalRules.OPTION_REQUIRED
|
|
||||||
},
|
|
||||||
widget: {
|
widget: {
|
||||||
disclaimerText: 'DisclaimerWidget',
|
disclaimerText: 'DisclaimerWidget',
|
||||||
subheader: 'SiteSubHeaderWidget',
|
subheader: 'SiteSubHeaderWidget',
|
||||||
verifiedItacAlert: 'VerifiedITACAlert',
|
|
||||||
explanatoryText: 'ExplanatoryTextWidget',
|
explanatoryText: 'ExplanatoryTextWidget',
|
||||||
nextStep: 'NextStepsWidget',
|
nextStep: 'NextStepsWidget'
|
||||||
serviceProviderQuestion: 'ServiceProviderQuestion'
|
|
||||||
},
|
},
|
||||||
CANCEL_CLAIM_REF_NAME,
|
RECAL_MODAL_REF_NAME
|
||||||
RECAL_MODAL_REF_NAME,
|
|
||||||
DEDUCTIBLE_MODAL_REF_NAME,
|
|
||||||
SITE_FOOTER_REF_NAME
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -231,27 +217,15 @@ export default {
|
||||||
widgetFields.SUB_HEADER_WIDGET.SUB_HEADER_TEXT
|
widgetFields.SUB_HEADER_WIDGET.SUB_HEADER_TEXT
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
verifiedItacAlertHeader() {
|
secondaryText() {
|
||||||
return this.getCmsContent(
|
|
||||||
this.widget.verifiedItacAlert,
|
|
||||||
widgetFields.ALERT_WIDGET.HEADLINE_TEXT
|
|
||||||
);
|
|
||||||
},
|
|
||||||
verifiedItacAlertBody() {
|
|
||||||
const itacCostSavings =
|
const itacCostSavings =
|
||||||
this.deductibleValue - this.totalServicePrice;
|
this.deductibleValue - this.totalServicePrice;
|
||||||
return this.getCmsContent(
|
|
||||||
this.widget.verifiedItacAlert,
|
|
||||||
widgetFields.ALERT_WIDGET.BODY_TEXT
|
|
||||||
)?.replaceAll(
|
|
||||||
'{custom:costSavings}',
|
|
||||||
formatAmountInDollars(itacCostSavings)
|
|
||||||
);
|
|
||||||
},
|
|
||||||
secondaryText() {
|
|
||||||
return this.getTextFromCmsWithCustomIfStatements(
|
return this.getTextFromCmsWithCustomIfStatements(
|
||||||
this.widget.subheader,
|
this.widget.subheader,
|
||||||
widgetFields.SUB_HEADER_WIDGET.SECONDARY_TEXT
|
widgetFields.SUB_HEADER_WIDGET.SECONDARY_TEXT
|
||||||
|
)?.replaceAll(
|
||||||
|
'{custom:costSavings}',
|
||||||
|
formatAmountInDollars(itacCostSavings)
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
disclaimerText() {
|
disclaimerText() {
|
||||||
|
|
@ -266,6 +240,12 @@ export default {
|
||||||
widgetFields.CONTENT_GROUP_WIDGET.BODY_TEXT
|
widgetFields.CONTENT_GROUP_WIDGET.BODY_TEXT
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
explanatoryText2() {
|
||||||
|
return this.getTextFromCmsWithCustomIfStatements(
|
||||||
|
this.widget.explanatoryText,
|
||||||
|
widgetFields.CONTENT_GROUP_WIDGET.BODY_TEXT_2
|
||||||
|
)?.replaceAll('{custom:currentReplaceDeductible}', formatAmountInDollars(this.mainStore.order.currentDeductible.replace));
|
||||||
|
},
|
||||||
nextStepsHeader() {
|
nextStepsHeader() {
|
||||||
return this.getTextFromCmsWithCustomIfStatements(
|
return this.getTextFromCmsWithCustomIfStatements(
|
||||||
this.widget.nextStep,
|
this.widget.nextStep,
|
||||||
|
|
@ -278,6 +258,9 @@ export default {
|
||||||
widgetFields.CONTENT_GROUP_WIDGET.BODY_TEXT
|
widgetFields.CONTENT_GROUP_WIDGET.BODY_TEXT
|
||||||
)?.replaceAll('{custom:damage}', this.damageText);
|
)?.replaceAll('{custom:damage}', this.damageText);
|
||||||
|
|
||||||
|
if (this.isITACQuoteVisible || this.isNoCompQuoteVisible) {
|
||||||
|
return createUnorderedListFromStringOfParagraphs(cmsText);
|
||||||
|
}
|
||||||
return createOrderedListFromStringOfParagraphs(cmsText);
|
return createOrderedListFromStringOfParagraphs(cmsText);
|
||||||
},
|
},
|
||||||
damageText() {
|
damageText() {
|
||||||
|
|
@ -285,7 +268,7 @@ export default {
|
||||||
return damageString === 'match' ? '' : damageString;
|
return damageString === 'match' ? '' : damageString;
|
||||||
},
|
},
|
||||||
deductibleValue() {
|
deductibleValue() {
|
||||||
return useMainStore().order.currentDeductible;
|
return this.mainStore.currentDeductible;
|
||||||
},
|
},
|
||||||
isNoCompQuoteVisible() {
|
isNoCompQuoteVisible() {
|
||||||
return this.mainStore.isVerified && this.mainStore.isNoComp;
|
return this.mainStore.isVerified && this.mainStore.isNoComp;
|
||||||
|
|
@ -309,21 +292,15 @@ export default {
|
||||||
totalServicePrice() {
|
totalServicePrice() {
|
||||||
return getPriceOfLineItems(this.baseServiceLineItems);
|
return getPriceOfLineItems(this.baseServiceLineItems);
|
||||||
},
|
},
|
||||||
serviceProviderQuestionText() {
|
|
||||||
return this.getCmsContent(
|
|
||||||
this.widget.serviceProviderQuestion,
|
|
||||||
widgetFields.INPUT_QUESTION_WIDGET.QUESTION_TEXT
|
|
||||||
);
|
|
||||||
},
|
|
||||||
serviceProviderQuestionAnswers() {
|
|
||||||
return this.getCmsContent(
|
|
||||||
this.widget.serviceProviderQuestion,
|
|
||||||
widgetFields.INPUT_QUESTION_WIDGET.ANSWERS
|
|
||||||
);
|
|
||||||
},
|
|
||||||
isQuoteDisplayed() {
|
isQuoteDisplayed() {
|
||||||
|
return this.isNoCompQuoteVisible;
|
||||||
|
},
|
||||||
|
isDisclaimerVisible() {
|
||||||
return this.isITACQuoteVisible || this.isNoCompQuoteVisible;
|
return this.isITACQuoteVisible || this.isNoCompQuoteVisible;
|
||||||
},
|
},
|
||||||
|
showDeductibleOnly() {
|
||||||
|
return this.isDeductibleVisible && !this.isRepairZeroDeductible;
|
||||||
|
},
|
||||||
shouldRegisterClaim() {
|
shouldRegisterClaim() {
|
||||||
const {
|
const {
|
||||||
vehicle,
|
vehicle,
|
||||||
|
|
@ -342,29 +319,24 @@ export default {
|
||||||
},
|
},
|
||||||
isRepair() {
|
isRepair() {
|
||||||
return this.mainStore.order.damage.isRepair;
|
return this.mainStore.order.damage.isRepair;
|
||||||
|
},
|
||||||
|
isRepairZeroDeductible() {
|
||||||
|
return this.isRepair && this.isDeductibleVisible && this.deductibleValue <= 0;
|
||||||
|
},
|
||||||
|
buttonText() {
|
||||||
|
return (this.isITACQuoteVisible || this.isNoCompQuoteVisible) ? 'Continue scheduling' : 'Continue';
|
||||||
|
},
|
||||||
|
getVariant() {
|
||||||
|
if (this.isITACQuoteVisible || this.isNoCompQuoteVisible) {
|
||||||
|
return 'text-center';
|
||||||
|
}
|
||||||
|
return 'text-left';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
selectedProvider() {
|
|
||||||
if (this.selectedProvider) {
|
|
||||||
if (this.selectedProvider !== SAFELITE_PROVIDER) {
|
|
||||||
this.$refs[this.CANCEL_CLAIM_REF_NAME].openModal();
|
|
||||||
this.selectedProvider = '';
|
|
||||||
this.$refs.siteFooter.disableForwardButton();
|
|
||||||
} else {
|
|
||||||
this.$refs.siteFooter.enableForwardAction();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
nextStepsBody(newValue, oldValue) {
|
nextStepsBody(newValue, oldValue) {
|
||||||
if (newValue !== oldValue) {
|
if (newValue !== oldValue) {
|
||||||
setupModalLink(this, RECAL_MODAL_REF_NAME);
|
setupModalLink(this, RECAL_MODAL_REF_NAME);
|
||||||
setupModalLink(this, DEDUCTIBLE_MODAL_REF_NAME);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
verifiedItacAlertBody(newValue, oldValue) {
|
|
||||||
if (newValue !== oldValue) {
|
|
||||||
setupModalLink(this, DEDUCTIBLE_MODAL_REF_NAME);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -421,15 +393,10 @@ export default {
|
||||||
if (this.isUnverifiedVisible || this.isDeductibleVisible) {
|
if (this.isUnverifiedVisible || this.isDeductibleVisible) {
|
||||||
this.navigateWithScenario(navigationScenarios.CLICKED_FORWARD);
|
this.navigateWithScenario(navigationScenarios.CLICKED_FORWARD);
|
||||||
} else if (this.isITACQuoteVisible || this.isNoCompQuoteVisible) {
|
} else if (this.isITACQuoteVisible || this.isNoCompQuoteVisible) {
|
||||||
useMainStore().updateIsSafeliteProvider(this.selectedProvider === SAFELITE_PROVIDER);
|
this.mainStore.updateIsSafeliteProvider(true);
|
||||||
if (this.selectedProvider === SAFELITE_PROVIDER) {
|
this.navigateWithScenario(navigationScenarios.CLICKED_FORWARD_WITH_SAFELITE);
|
||||||
this.navigateWithScenario(navigationScenarios.CLICKED_FORWARD_WITH_SAFELITE);
|
|
||||||
} else {
|
|
||||||
useMainStore().setBailout(bailoutMessage.RequestCallback());
|
|
||||||
this.navigateWithScenario(navigationScenarios.CLICKED_FORWARD_WITH_NON_SAFELITE_SHOP);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
useMainStore().setBailout(bailoutMessage.coverageStatementInvalidState());
|
this.mainStore.setBailout(bailoutMessage.coverageStatementInvalidState());
|
||||||
this.navigateWithScenario(navigationScenarios.CLICKED_FORWARD_WITH_INVALID_STATE);
|
this.navigateWithScenario(navigationScenarios.CLICKED_FORWARD_WITH_INVALID_STATE);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -449,28 +416,24 @@ export default {
|
||||||
switch (str) {
|
switch (str) {
|
||||||
case 'coverageUnverified':
|
case 'coverageUnverified':
|
||||||
return this.isUnverifiedVisible;
|
return this.isUnverifiedVisible;
|
||||||
case 'verifiedDeductible':
|
|
||||||
return this.isDeductibleVisible;
|
|
||||||
case 'verifiedITAC':
|
case 'verifiedITAC':
|
||||||
return this.isITACQuoteVisible;
|
return this.isITACQuoteVisible;
|
||||||
case 'verifiedNoComp':
|
case 'verifiedNoComp':
|
||||||
return this.isNoCompQuoteVisible;
|
return this.isNoCompQuoteVisible;
|
||||||
case 'ADASReplace':
|
case 'ADASReplace':
|
||||||
return !isRepair && this.isADAS;
|
return !isRepair && this.isADAS && !this.isNoCompQuoteVisible && !this.isITACQuoteVisible;
|
||||||
case 'nonADASReplace':
|
case 'nonADASReplace':
|
||||||
return !isRepair && !this.isADAS;
|
return !isRepair && !this.isADAS && !this.isNoCompQuoteVisible && !this.isITACQuoteVisible;
|
||||||
case 'nonADASRepair':
|
case 'verifiedRepairDeductible':
|
||||||
return isRepair;
|
|
||||||
case 'deductibleOverZero':
|
|
||||||
return (
|
|
||||||
this.isDeductibleVisible && this.deductibleValue > 0
|
|
||||||
);
|
|
||||||
case 'isDeductibleZero':
|
|
||||||
return (
|
|
||||||
this.isDeductibleVisible && this.deductibleValue <= 0
|
|
||||||
);
|
|
||||||
case 'verifiedRepair':
|
|
||||||
return isRepair && this.isDeductibleVisible;
|
return isRepair && this.isDeductibleVisible;
|
||||||
|
case 'verifiedRepairZeroDeductible':
|
||||||
|
return isRepair && this.isDeductibleVisible && this.deductibleValue <= 0;
|
||||||
|
case 'verifiedRepairZeroDeductibleReplaceDeductibleOverZero':
|
||||||
|
return isRepair && this.isDeductibleVisible && this.deductibleValue <= 0 && this.mainStore.order.currentDeductible.replace > 0;
|
||||||
|
case 'verifiedRepairDeductibleOverZero':
|
||||||
|
return isRepair && this.isDeductibleVisible && this.deductibleValue > 0;
|
||||||
|
case 'verifiedReplaceDeductible':
|
||||||
|
return !isRepair && this.isDeductibleVisible;
|
||||||
case 'verifiedReplaceZeroDeductible':
|
case 'verifiedReplaceZeroDeductible':
|
||||||
return !isRepair && this.isDeductibleVisible && this.deductibleValue <= 0;
|
return !isRepair && this.isDeductibleVisible && this.deductibleValue <= 0;
|
||||||
case 'verifiedReplaceDeductibleOverZero':
|
case 'verifiedReplaceDeductibleOverZero':
|
||||||
|
|
@ -484,13 +447,9 @@ export default {
|
||||||
},
|
},
|
||||||
formatAmountInDollars,
|
formatAmountInDollars,
|
||||||
cancelClaim() {
|
cancelClaim() {
|
||||||
useMainStore().updateIsSafeliteProvider(false);
|
this.mainStore.updateIsSafeliteProvider(false);
|
||||||
useMainStore().setBailout(bailoutMessage.RequestCallback());
|
this.mainStore.setBailout(bailoutMessage.RequestCallback());
|
||||||
this.navigateWithScenario(navigationScenarios.CLICKED_FORWARD_WITH_NON_SAFELITE_SHOP);
|
this.navigateWithScenario(navigationScenarios.CLICKED_FORWARD_WITH_NON_SAFELITE_SHOP);
|
||||||
},
|
|
||||||
continueClaim() {
|
|
||||||
useMainStore().updateIsSafeliteProvider(true);
|
|
||||||
this.navigateWithScenario(navigationScenarios.CLICKED_FORWARD_WITH_SAFELITE);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -501,46 +460,82 @@ export default {
|
||||||
.coverage-statement-container {
|
.coverage-statement-container {
|
||||||
position: relative;
|
position: relative;
|
||||||
min-height: 1px;
|
min-height: 1px;
|
||||||
padding-left: .9375rem;
|
padding-left: .75rem;
|
||||||
padding-right: .9375rem;
|
padding-right: .75rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.coverage-statement {
|
.coverage-statement {
|
||||||
.cost {
|
.cost {
|
||||||
color: $green;
|
color: $green;
|
||||||
font-size: 2rem;
|
font-size: 1.675rem;
|
||||||
font-weight: $font-weight-light;
|
font-weight: $font-weight-bold;
|
||||||
line-height: 2.75rem;
|
line-height: 2.5rem;
|
||||||
|
width: fit-content;
|
||||||
}
|
}
|
||||||
.deductible-text {
|
.cost-underline {
|
||||||
line-height: 1.5rem;
|
border-bottom: 4px solid #0c7e47;
|
||||||
}
|
}
|
||||||
.sub-header {
|
.sub-header {
|
||||||
line-height: 2rem;
|
line-height: 1.5rem;
|
||||||
|
margin-top: 20px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.full-width-button {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.underlined-text {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
.cancel-link {
|
||||||
|
display: block;
|
||||||
|
margin: 24px auto 0 auto;
|
||||||
|
}
|
||||||
|
.back-link {
|
||||||
|
display: inline-block;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
:deep(.body-text > ol > ul) {
|
||||||
|
list-style-position: outside;
|
||||||
|
list-style-type: disc;
|
||||||
|
padding-left: 0;
|
||||||
}
|
}
|
||||||
:deep(ol) {
|
:deep(ol) {
|
||||||
|
padding-left: 1.25rem;
|
||||||
|
}
|
||||||
|
:deep(li) {
|
||||||
|
margin-top: 1px;
|
||||||
|
padding-left: 5px;
|
||||||
|
}
|
||||||
|
:deep(ul) {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
padding-left: 1.125rem;
|
padding-left: 1.25rem;
|
||||||
padding-right: 1.125rem;
|
padding-right: 1.25rem;
|
||||||
line-height: 1.5rem;
|
line-height: 1.25rem;
|
||||||
font-size: .875rem;
|
|
||||||
|
|
||||||
li {
|
li {
|
||||||
margin-bottom: .5rem;
|
margin-top: .5rem;
|
||||||
|
padding-left: 5px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
:deep(p) {
|
:deep(p) {
|
||||||
line-height: 1.5rem;
|
line-height: 1.5rem;
|
||||||
font-size: 0.875rem;
|
|
||||||
margin-bottom: 0.5rem;
|
margin-bottom: 0.5rem;
|
||||||
strong {
|
strong {
|
||||||
color: $black;
|
color: $black;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
:deep(.body-text) {
|
:deep(.body-text) {
|
||||||
font-size: 0.875rem;
|
|
||||||
line-height: 1.5rem;
|
line-height: 1.5rem;
|
||||||
|
color: $darker-gray;
|
||||||
|
strong {
|
||||||
|
color: $black;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
margin-top: 6px;
|
||||||
|
a {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
:deep(.question-text) {
|
:deep(.question-text) {
|
||||||
margin-top: 1.5rem;
|
margin-top: 1.5rem;
|
||||||
|
|
@ -560,20 +555,45 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
.itac-price-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-around;
|
||||||
|
border: solid 1px #cacbcc;
|
||||||
|
border-radius: 5px;
|
||||||
|
align-items: center;
|
||||||
|
font-weight: $font-weight-bold;
|
||||||
|
color: $black;
|
||||||
|
padding: 10px;
|
||||||
|
margin-top: 20px;
|
||||||
|
|
||||||
:deep(.deductible-modal) {
|
.itac-deductible-value-container {
|
||||||
p {
|
display: flex;
|
||||||
margin-bottom: 0 !important;
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.itac-cost-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.itac-deductible-value {
|
||||||
|
font-size: 1.675rem;
|
||||||
|
font-weight: $font-weight-normal;
|
||||||
|
line-height: 2.5rem;
|
||||||
|
}
|
||||||
|
.separator {
|
||||||
|
width: 1px;
|
||||||
|
height: 60px;
|
||||||
|
background-color: #cacbcc;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
img.mb-4 {
|
.no-comp-price-text {
|
||||||
margin: 0 !important;
|
font-weight: 500;
|
||||||
|
color: $black;
|
||||||
}
|
}
|
||||||
h5 {
|
:deep(.line-two) {
|
||||||
color: black;
|
margin-top: 20px;
|
||||||
}
|
display: block;
|
||||||
p:last-child {
|
|
||||||
margin-top: 0.5rem;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -84,6 +84,13 @@ const initialStore = {
|
||||||
lastName: 'Test',
|
lastName: 'Test',
|
||||||
servicePhone: '111-111-1111',
|
servicePhone: '111-111-1111',
|
||||||
emailAddress: 'test@email.com'
|
emailAddress: 'test@email.com'
|
||||||
|
},
|
||||||
|
damage: {
|
||||||
|
isRepair: false
|
||||||
|
},
|
||||||
|
currentDeductible: {
|
||||||
|
replace: 100,
|
||||||
|
repair: 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -123,14 +130,20 @@ const sessionStorage = {
|
||||||
vaps: []
|
vaps: []
|
||||||
},
|
},
|
||||||
policy: {},
|
policy: {},
|
||||||
damage: {},
|
damage: {
|
||||||
|
isRepair: false
|
||||||
|
},
|
||||||
vehicle: {
|
vehicle: {
|
||||||
year: 2000,
|
year: 2000,
|
||||||
make: 'Honda',
|
make: 'Honda',
|
||||||
model: 'Civic'
|
model: 'Civic'
|
||||||
},
|
},
|
||||||
customer: {},
|
customer: {},
|
||||||
customerPortalLoginToken: 'token'
|
customerPortalLoginToken: 'token',
|
||||||
|
currentDeductible: {
|
||||||
|
replace: 100,
|
||||||
|
repair: 0
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function getMountedComponent(mainInitialState = {}, initialData = {}, methodToRun = () => {}, mixin = mockMixin) {
|
function getMountedComponent(mainInitialState = {}, initialData = {}, methodToRun = () => {}, mixin = mockMixin) {
|
||||||
|
|
|
||||||
|
|
@ -232,7 +232,9 @@ describe('payment-method.vue', () => {
|
||||||
coverageStatus: coverageStatuses.VERIFIED,
|
coverageStatus: coverageStatuses.VERIFIED,
|
||||||
coverageType: coverageType.Deductible
|
coverageType: coverageType.Deductible
|
||||||
},
|
},
|
||||||
currentDeductible: 123
|
currentDeductible: {
|
||||||
|
replace: 123
|
||||||
|
}
|
||||||
},
|
},
|
||||||
issConfig: {
|
issConfig: {
|
||||||
isClaimRegistrationRequired: true,
|
isClaimRegistrationRequired: true,
|
||||||
|
|
@ -286,7 +288,7 @@ describe('payment-method.vue', () => {
|
||||||
test('returns true when coverageStatus is verified and deductibleTotal = 0', () => {
|
test('returns true when coverageStatus is verified and deductibleTotal = 0', () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
store.order.insuranceCoverage.coverageStatus = coverageStatuses.VERIFIED;
|
store.order.insuranceCoverage.coverageStatus = coverageStatuses.VERIFIED;
|
||||||
store.order.currentDeductible = 0;
|
store.order.currentDeductible.replace = 0;
|
||||||
const wrapper = setupMocks({}, store, mixin);
|
const wrapper = setupMocks({}, store, mixin);
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
|
|
|
||||||
|
|
@ -153,7 +153,7 @@ export default {
|
||||||
isPayInAdvanceDisabled() {
|
isPayInAdvanceDisabled() {
|
||||||
const piaExperience = this.getSettingValue(experimentSettings.ISS_DISPLAY_PAY_IN_ADVANCE);
|
const piaExperience = this.getSettingValue(experimentSettings.ISS_DISPLAY_PAY_IN_ADVANCE);
|
||||||
const isEnabled = piaExperience === 'true';
|
const isEnabled = piaExperience === 'true';
|
||||||
const isDeductibleTotalEqualToZero = useMainStore().order.currentDeductible === 0;
|
const isDeductibleTotalEqualToZero = useMainStore().currentDeductible === 0;
|
||||||
|
|
||||||
return !isEnabled || useMainStore().isUnverified || (useMainStore().isDeductible && isDeductibleTotalEqualToZero);
|
return !isEnabled || useMainStore().isUnverified || (useMainStore().isDeductible && isDeductibleTotalEqualToZero);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -386,7 +386,7 @@ describe('tpa-submit', () => {
|
||||||
serviceLocation: {
|
serviceLocation: {
|
||||||
provider: {
|
provider: {
|
||||||
companyName: providerCompanyName
|
companyName: providerCompanyName
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
contactInfo: {
|
contactInfo: {
|
||||||
firstName,
|
firstName,
|
||||||
|
|
@ -431,7 +431,7 @@ describe('tpa-submit', () => {
|
||||||
serviceLocation: {
|
serviceLocation: {
|
||||||
provider: {
|
provider: {
|
||||||
companyName: providerCompanyName
|
companyName: providerCompanyName
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
contactInfo: {
|
contactInfo: {
|
||||||
firstName,
|
firstName,
|
||||||
|
|
@ -520,7 +520,9 @@ describe('tpa-submit', () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const initialStore = {
|
const initialStore = {
|
||||||
order: {
|
order: {
|
||||||
currentDeductible: storeValue
|
currentDeductible: {
|
||||||
|
replace: storeValue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const { wrapper } = getMountedComponent(initialStore);
|
const { wrapper } = getMountedComponent(initialStore);
|
||||||
|
|
@ -568,7 +570,10 @@ describe('tpa-submit', () => {
|
||||||
insuranceCoverage: {
|
insuranceCoverage: {
|
||||||
coverageStatus: status
|
coverageStatus: status
|
||||||
},
|
},
|
||||||
currentDeductible: deductible
|
currentDeductible: {
|
||||||
|
replace: deductible,
|
||||||
|
repair: deductible
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const { wrapper } = getMountedComponent(initialStore);
|
const { wrapper } = getMountedComponent(initialStore);
|
||||||
|
|
@ -596,7 +601,10 @@ describe('tpa-submit', () => {
|
||||||
insuranceCoverage: {
|
insuranceCoverage: {
|
||||||
coverageStatus: status
|
coverageStatus: status
|
||||||
},
|
},
|
||||||
currentDeductible: deductible
|
currentDeductible: {
|
||||||
|
replace: deductible,
|
||||||
|
repair: deductible
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const { wrapper } = getMountedComponent(initialStore);
|
const { wrapper } = getMountedComponent(initialStore);
|
||||||
|
|
|
||||||
|
|
@ -16,12 +16,11 @@
|
||||||
<alert
|
<alert
|
||||||
ref="alertIncomplete"
|
ref="alertIncomplete"
|
||||||
alertClass="alert-warning"
|
alertClass="alert-warning"
|
||||||
:cmsWidgetName="widget.alertIncomplete"
|
:cmsWidgetName="widget.alertIncomplete" />
|
||||||
/>
|
|
||||||
<textBlock
|
<textBlock
|
||||||
ref="subHeaderTitle"
|
ref="subHeaderTitle"
|
||||||
:customText="subHeaderTitle"
|
:customText="subHeaderTitle"
|
||||||
class="tpa-submit-title"/>
|
class="tpa-submit-title" />
|
||||||
<textBlock
|
<textBlock
|
||||||
id="tpaSubmitSubHeaderBodyOne"
|
id="tpaSubmitSubHeaderBodyOne"
|
||||||
ref="tpaSubmitSubHeaderBodyOne"
|
ref="tpaSubmitSubHeaderBodyOne"
|
||||||
|
|
@ -40,9 +39,15 @@
|
||||||
:headerText="recalModalContent.headerText"
|
:headerText="recalModalContent.headerText"
|
||||||
:footerButtonText="recalModalContent.footerButtonText"
|
:footerButtonText="recalModalContent.footerButtonText"
|
||||||
@footerButtonEvent="closeRecalModal">
|
@footerButtonEvent="closeRecalModal">
|
||||||
<div class="recal-modal-subheader">{{ recalModalContent.subHeaderText }}</div>
|
<div class="recal-modal-subheader">
|
||||||
<img class="recal-modal-image" :src="recalModalContent.image" />
|
{{ recalModalContent.subHeaderText }}
|
||||||
<div class="recal-modal-body" v-html="recalModalContent.bodyText"></div>
|
</div>
|
||||||
|
<img
|
||||||
|
class="recal-modal-image"
|
||||||
|
:src="recalModalContent.image" />
|
||||||
|
<div
|
||||||
|
class="recal-modal-body"
|
||||||
|
v-html="recalModalContent.bodyText"></div>
|
||||||
</modal>
|
</modal>
|
||||||
<hr />
|
<hr />
|
||||||
<div id="serviceSummarySection">
|
<div id="serviceSummarySection">
|
||||||
|
|
@ -155,7 +160,7 @@ export default {
|
||||||
alertIncomplete: 'AlertIncompleteWidget',
|
alertIncomplete: 'AlertIncompleteWidget',
|
||||||
alertRecalWarning: 'AlertRecalWarningWidget',
|
alertRecalWarning: 'AlertRecalWarningWidget',
|
||||||
editShopLinkText: 'EditShopLinkTextWidget',
|
editShopLinkText: 'EditShopLinkTextWidget',
|
||||||
contactDetails: 'ContactDetailsSectionWidget'
|
contactDetails: 'ContactDetailsSectionWidget'
|
||||||
},
|
},
|
||||||
modalPositions
|
modalPositions
|
||||||
};
|
};
|
||||||
|
|
@ -207,7 +212,7 @@ export default {
|
||||||
return this.mainStore.isVerified;
|
return this.mainStore.isVerified;
|
||||||
},
|
},
|
||||||
currentDeductible() {
|
currentDeductible() {
|
||||||
return this.mainStore.order.currentDeductible;
|
return this.mainStore.currentDeductible;
|
||||||
},
|
},
|
||||||
deductibleBoxValue() {
|
deductibleBoxValue() {
|
||||||
return this.isVerified
|
return this.isVerified
|
||||||
|
|
@ -269,7 +274,7 @@ export default {
|
||||||
bodyText: this.getCmsContent(widgetName, widgetFields.CONTENT_GROUP_WIDGET.BODY_TEXT),
|
bodyText: this.getCmsContent(widgetName, widgetFields.CONTENT_GROUP_WIDGET.BODY_TEXT),
|
||||||
footerButtonText: this.getCmsContent(widgetName, widgetFields.CONTENT_GROUP_WIDGET.FOOTER_TEXT),
|
footerButtonText: this.getCmsContent(widgetName, widgetFields.CONTENT_GROUP_WIDGET.FOOTER_TEXT),
|
||||||
image: this.getCmsContent(widgetName, widgetFields.CONTENT_GROUP_WIDGET.IMAGE)
|
image: this.getCmsContent(widgetName, widgetFields.CONTENT_GROUP_WIDGET.IMAGE)
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
recalibrationRequired() {
|
recalibrationRequired() {
|
||||||
return this.mainStore.hasRecalibrationPart;
|
return this.mainStore.hasRecalibrationPart;
|
||||||
|
|
@ -281,9 +286,9 @@ export default {
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
glassShop: this.getPreferredShopTitle,
|
glassShop: this.getPreferredShopTitle,
|
||||||
contactPhone: contactPhone,
|
contactPhone,
|
||||||
contactEmail: this.mainStore.contactInfo.emailAddress ?? ''
|
contactEmail: this.mainStore.contactInfo.emailAddress ?? ''
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -293,7 +298,7 @@ export default {
|
||||||
this.getPreferredShopTitle,
|
this.getPreferredShopTitle,
|
||||||
this.getPreferredShopLines,
|
this.getPreferredShopLines,
|
||||||
this.getEditShopLinkText,
|
this.getEditShopLinkText,
|
||||||
() => this.navigate(this.navigationScenarios.EDIT_PREFERRED_SHOP),
|
() => this.navigate(this.navigationScenarios.EDIT_PREFERRED_SHOP)
|
||||||
),
|
),
|
||||||
// eslint-disable-next-line max-len
|
// eslint-disable-next-line max-len
|
||||||
this.getSection(
|
this.getSection(
|
||||||
|
|
@ -306,7 +311,7 @@ export default {
|
||||||
},
|
},
|
||||||
getSection(title, lines, editLinkText, onClick) {
|
getSection(title, lines, editLinkText, onClick) {
|
||||||
return {
|
return {
|
||||||
title: title,
|
title,
|
||||||
lines,
|
lines,
|
||||||
editLinkText,
|
editLinkText,
|
||||||
onClickEdit: onClick
|
onClickEdit: onClick
|
||||||
|
|
|
||||||
|
|
@ -220,8 +220,16 @@ export const getDefaultState = () => ({
|
||||||
settledTenderAmount: null,
|
settledTenderAmount: null,
|
||||||
lockToken: null,
|
lockToken: null,
|
||||||
customerPortalLoginToken: null,
|
customerPortalLoginToken: null,
|
||||||
originalDeductible: null,
|
originalDeductible: {
|
||||||
currentDeductible: null,
|
repair: null,
|
||||||
|
replace: null
|
||||||
|
},
|
||||||
|
currentDeductible: {
|
||||||
|
repair: null,
|
||||||
|
replace: null
|
||||||
|
},
|
||||||
|
totalTaxAmount: null,
|
||||||
|
waiverReasons: null,
|
||||||
carrierPhoneNumber: null,
|
carrierPhoneNumber: null,
|
||||||
loadedFromCookie: false,
|
loadedFromCookie: false,
|
||||||
loadedFromDupeCheck: null,
|
loadedFromDupeCheck: null,
|
||||||
|
|
@ -439,7 +447,9 @@ export const useMainStore = defineStore({
|
||||||
experimentSettings: (state) => state.applicationUser.experiments
|
experimentSettings: (state) => state.applicationUser.experiments
|
||||||
.filter((x) => !!x.isActive)
|
.filter((x) => !!x.isActive)
|
||||||
.map((x) => x.settings)
|
.map((x) => x.settings)
|
||||||
.reduce((r, c) => Object.assign(r, c), {}) ?? {}
|
.reduce((r, c) => Object.assign(r, c), {}) ?? {},
|
||||||
|
originalDeductible: (state) => (state.order.damage.isRepair ? state.order.originalDeductible.repair : state.order.originalDeductible.replace),
|
||||||
|
currentDeductible: (state) => (state.order.damage.isRepair ? state.order.currentDeductible.repair : state.order.currentDeductible.replace)
|
||||||
},
|
},
|
||||||
actions:
|
actions:
|
||||||
{
|
{
|
||||||
|
|
@ -653,7 +663,7 @@ export const useMainStore = defineStore({
|
||||||
safelitePolicy: {
|
safelitePolicy: {
|
||||||
policies: []
|
policies: []
|
||||||
},
|
},
|
||||||
actualDeductible: this.order.currentDeductible?.toString() ?? ''
|
actualDeductible: this.currentDeductible.toString() ?? ''
|
||||||
},
|
},
|
||||||
lossInfo: {
|
lossInfo: {
|
||||||
dateOfLoss: this.order.policy.dateOfLoss,
|
dateOfLoss: this.order.policy.dateOfLoss,
|
||||||
|
|
@ -716,8 +726,8 @@ export const useMainStore = defineStore({
|
||||||
manualGlassNames: manualGlassNamesArray,
|
manualGlassNames: manualGlassNamesArray,
|
||||||
policyState: this.order.customer.address.state,
|
policyState: this.order.customer.address.state,
|
||||||
status: this.order.policy.status,
|
status: this.order.policy.status,
|
||||||
originalDeductible: this.order.originalDeductible,
|
originalDeductible: this.originalDeductible,
|
||||||
currentDeductible: this.order.currentDeductible,
|
currentDeductible: this.currentDeductible,
|
||||||
noCoverage: false,
|
noCoverage: false,
|
||||||
isRepair: this.order.damage.isRepair,
|
isRepair: this.order.damage.isRepair,
|
||||||
policyNumber: this.order.policy.policyNumber,
|
policyNumber: this.order.policy.policyNumber,
|
||||||
|
|
@ -731,7 +741,7 @@ export const useMainStore = defineStore({
|
||||||
}
|
}
|
||||||
}).then((r) => {
|
}).then((r) => {
|
||||||
this.order.policy.policyData = r.data.policyData;
|
this.order.policy.policyData = r.data.policyData;
|
||||||
this.updateDeductible(r.data.deductible);
|
this.updateDeductible(r.data);
|
||||||
return resolve(r);
|
return resolve(r);
|
||||||
}).catch((error) => reject(error));
|
}).catch((error) => reject(error));
|
||||||
});
|
});
|
||||||
|
|
@ -1198,7 +1208,7 @@ export const useMainStore = defineStore({
|
||||||
Model: vehicle.model
|
Model: vehicle.model
|
||||||
},
|
},
|
||||||
Insurance: {
|
Insurance: {
|
||||||
Deductible: this.order.currentDeductible ?? 0,
|
Deductible: this.currentDeductible ?? 0,
|
||||||
PolicyNumber: policy.policyNumber,
|
PolicyNumber: policy.policyNumber,
|
||||||
CoverageStatus: insuranceCoverage.coverageStatus,
|
CoverageStatus: insuranceCoverage.coverageStatus,
|
||||||
CoverageType: insuranceCoverage.coverageType
|
CoverageType: insuranceCoverage.coverageType
|
||||||
|
|
@ -1448,8 +1458,8 @@ export const useMainStore = defineStore({
|
||||||
},
|
},
|
||||||
policyNumber: policy.policyNumber,
|
policyNumber: policy.policyNumber,
|
||||||
policyZipCode: policy.policyZipCode,
|
policyZipCode: policy.policyZipCode,
|
||||||
originalDeductible: this.order.originalDeductible,
|
originalDeductible: this.originalDeductible,
|
||||||
currentDeductible: this.order.currentDeductible,
|
currentDeductible: this.currentDeductible,
|
||||||
OemEndorsement: this.hasOemEndorsement,
|
OemEndorsement: this.hasOemEndorsement,
|
||||||
noCoverage: this.isNoComp,
|
noCoverage: this.isNoComp,
|
||||||
isItac: this.isITAC
|
isItac: this.isITAC
|
||||||
|
|
@ -2031,9 +2041,10 @@ export const useMainStore = defineStore({
|
||||||
this.order.policy.deductible.repair = coverage?.repairWaived ?? false ? 0 : coverage.deductible;
|
this.order.policy.deductible.repair = coverage?.repairWaived ?? false ? 0 : coverage.deductible;
|
||||||
this.order.policy.endorsements = coverage?.endorsements;
|
this.order.policy.endorsements = coverage?.endorsements;
|
||||||
|
|
||||||
// TODO logic should be more complicated later on
|
this.order.originalDeductible.replace = this.order.policy.deductible.replace;
|
||||||
this.order.originalDeductible = coverage.deductible;
|
this.order.currentDeductible.replace = this.order.policy.deductible.replace;
|
||||||
this.order.currentDeductible = coverage.deductible;
|
this.order.originalDeductible.repair = this.order.policy.deductible.repair;
|
||||||
|
this.order.currentDeductible.repair = this.order.policy.deductible.repair;
|
||||||
},
|
},
|
||||||
|
|
||||||
resetOrder() {
|
resetOrder() {
|
||||||
|
|
@ -2046,8 +2057,10 @@ export const useMainStore = defineStore({
|
||||||
this.order.settledTenderAmount = null;
|
this.order.settledTenderAmount = null;
|
||||||
this.order.lockToken = null;
|
this.order.lockToken = null;
|
||||||
this.order.eon = null;
|
this.order.eon = null;
|
||||||
this.order.originalDeductible = null;
|
this.order.originalDeductible.repair = null;
|
||||||
this.order.currentDeductible = null;
|
this.order.originalDeductible.replace = null;
|
||||||
|
this.order.currentDeductible.repair = null;
|
||||||
|
this.order.currentDeductible.replace = null;
|
||||||
this.order.loadedFromDupeCheck = null;
|
this.order.loadedFromDupeCheck = null;
|
||||||
this.order.loadedSessionClearedPreviousData = null;
|
this.order.loadedSessionClearedPreviousData = null;
|
||||||
this.order.availableVaps = null;
|
this.order.availableVaps = null;
|
||||||
|
|
@ -2317,8 +2330,12 @@ export const useMainStore = defineStore({
|
||||||
updateIsSafeliteProvider(isSafelite) {
|
updateIsSafeliteProvider(isSafelite) {
|
||||||
this.order.serviceLocation.IsSafeliteProvider = isSafelite;
|
this.order.serviceLocation.IsSafeliteProvider = isSafelite;
|
||||||
},
|
},
|
||||||
updateDeductible(finalDeductible) {
|
updateDeductible(deductibleInfo) {
|
||||||
this.order.currentDeductible = finalDeductible;
|
if (this.order.damage.isRepair) {
|
||||||
|
this.order.currentDeductible.repair = deductibleInfo.deductible;
|
||||||
|
} else {
|
||||||
|
this.order.currentDeductible.replace = deductibleInfo.deductible;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
savePartQuestionAnswers(partQuestionAnswersArray) {
|
savePartQuestionAnswers(partQuestionAnswersArray) {
|
||||||
// if part question answers have changed, reset subsequent question answers
|
// if part question answers have changed, reset subsequent question answers
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ import coverageStatuses from '@/constants/coverage-statuses.js';
|
||||||
import { paymentMethods } from '@/constants/payment-method-constants';
|
import { paymentMethods } from '@/constants/payment-method-constants';
|
||||||
import endpoints from '@/constants/endpoints';
|
import endpoints from '@/constants/endpoints';
|
||||||
import { AppointmentTypeStrings } from '@/constants/schedule-constants';
|
import { AppointmentTypeStrings } from '@/constants/schedule-constants';
|
||||||
import bailoutCode from '@/constants/bailoutCode';
|
|
||||||
import coverageType from '@/constants/coverage-type';
|
import coverageType from '@/constants/coverage-type';
|
||||||
import { getEnumName } from '@/helpers/unit-test-helper';
|
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}`, () => {
|
test(`CoverageType is set to expected ${getEnumName(coverageType, expected)} when vehicle noCoverage is ${noCoverage} and enableNoCompQuote is ${enableNoCompQuote}`, () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
store.issConfig.enableNoCompQuote = enableNoCompQuote;
|
store.issConfig.enableNoCompQuote = enableNoCompQuote;
|
||||||
|
store.order.currentDeductible = {
|
||||||
|
replace: 500,
|
||||||
|
repair: 0
|
||||||
|
};
|
||||||
const vehicleCoverage = {
|
const vehicleCoverage = {
|
||||||
noCoverage
|
noCoverage
|
||||||
};
|
};
|
||||||
|
|
@ -407,6 +410,10 @@ describe('Store', () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
store.order.insuranceCoverage.coverageType = coverageType.NO_COMP;
|
store.order.insuranceCoverage.coverageType = coverageType.NO_COMP;
|
||||||
|
store.order.currentDeductible = {
|
||||||
|
replace: 500,
|
||||||
|
repair: 0
|
||||||
|
};
|
||||||
|
|
||||||
globalMethods.callHttpClient = jest.fn().mockReturnValue(Promise.resolve(response));
|
globalMethods.callHttpClient = jest.fn().mockReturnValue(Promise.resolve(response));
|
||||||
|
|
||||||
|
|
@ -434,6 +441,10 @@ describe('Store', () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
store.order.insuranceCoverage.coverageType = coverageType.Deductible;
|
store.order.insuranceCoverage.coverageType = coverageType.Deductible;
|
||||||
|
store.order.currentDeductible = {
|
||||||
|
replace: 500,
|
||||||
|
repair: 0
|
||||||
|
};
|
||||||
|
|
||||||
globalMethods.callHttpClient = jest.fn().mockReturnValue(Promise.resolve(response));
|
globalMethods.callHttpClient = jest.fn().mockReturnValue(Promise.resolve(response));
|
||||||
|
|
||||||
|
|
@ -453,6 +464,10 @@ describe('Store', () => {
|
||||||
const error = 'register claim error';
|
const error = 'register claim error';
|
||||||
globalMethods.callHttpClient = jest.fn().mockReturnValue(Promise.reject(error));
|
globalMethods.callHttpClient = jest.fn().mockReturnValue(Promise.reject(error));
|
||||||
store.order.insuranceCoverage.coverageStatus = coverageStatuses.PENDING;
|
store.order.insuranceCoverage.coverageStatus = coverageStatuses.PENDING;
|
||||||
|
store.order.currentDeductible = {
|
||||||
|
replace: 500,
|
||||||
|
repair: 0
|
||||||
|
};
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
await store.registerClaim().catch((e) => {
|
await store.registerClaim().catch((e) => {
|
||||||
|
|
@ -501,7 +516,7 @@ describe('Store', () => {
|
||||||
home: homePhone,
|
home: homePhone,
|
||||||
service: servicePhone,
|
service: servicePhone,
|
||||||
alternative: altPhone,
|
alternative: altPhone,
|
||||||
extension: extension
|
extension
|
||||||
});
|
});
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
|
|
@ -670,10 +685,22 @@ describe('Store', () => {
|
||||||
const policyZipCode = getRandomString(6, 6);
|
const policyZipCode = getRandomString(6, 6);
|
||||||
const status = getRandomEnum(coverageStatuses);
|
const status = getRandomEnum(coverageStatuses);
|
||||||
const type = getRandomEnum(coverageType);
|
const type = getRandomEnum(coverageType);
|
||||||
const originalDeductible = getRandomString(6, 6);
|
const originalDeductible = {
|
||||||
const currentDeductible = getRandomString(6, 6);
|
replace: 500,
|
||||||
store.order.originalDeductible = originalDeductible;
|
repair: 0
|
||||||
store.order.currentDeductible = currentDeductible;
|
};
|
||||||
|
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.firstName = customerFirstName;
|
||||||
store.order.customer.lastName = customerLastName;
|
store.order.customer.lastName = customerLastName;
|
||||||
store.order.customer.emailAddress = customerEmail;
|
store.order.customer.emailAddress = customerEmail;
|
||||||
|
|
@ -684,6 +711,7 @@ describe('Store', () => {
|
||||||
store.order.policy.policyZipCode = policyZipCode;
|
store.order.policy.policyZipCode = policyZipCode;
|
||||||
store.order.insuranceCoverage.coverageStatus = status;
|
store.order.insuranceCoverage.coverageStatus = status;
|
||||||
store.order.insuranceCoverage.coverageType = type;
|
store.order.insuranceCoverage.coverageType = type;
|
||||||
|
store.order.damage.isRepair = false;
|
||||||
globalMethods.callHttpClient = jest.fn().mockReturnValue(Promise.resolve({}));
|
globalMethods.callHttpClient = jest.fn().mockReturnValue(Promise.resolve({}));
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
|
|
@ -702,8 +730,8 @@ describe('Store', () => {
|
||||||
}),
|
}),
|
||||||
policyNumber,
|
policyNumber,
|
||||||
policyZipCode,
|
policyZipCode,
|
||||||
originalDeductible,
|
originalDeductible: originalDeductible.replace,
|
||||||
currentDeductible
|
currentDeductible: currentDeductible.replace
|
||||||
}),
|
}),
|
||||||
insuranceCoverage: expect.objectContaining({
|
insuranceCoverage: expect.objectContaining({
|
||||||
coverageStatus: status,
|
coverageStatus: status,
|
||||||
|
|
@ -1717,8 +1745,8 @@ describe('Store', () => {
|
||||||
const manualGlassNames = [location];
|
const manualGlassNames = [location];
|
||||||
const policyState = getRandomString(2, 2);
|
const policyState = getRandomString(2, 2);
|
||||||
const status = getRandomString(6, 8);
|
const status = getRandomString(6, 8);
|
||||||
const currentDeductible = getRandomInt(0, 5000);
|
const currentDeductible = 500;
|
||||||
const originalDeductible = getRandomInt(0, 5000);
|
const originalDeductible = 500;
|
||||||
const isRepair = getRandomBoolean();
|
const isRepair = getRandomBoolean();
|
||||||
const policyNumber = getRandomString(10, 20);
|
const policyNumber = getRandomString(10, 20);
|
||||||
const insuredFirstName = getRandomString(10, 20);
|
const insuredFirstName = getRandomString(10, 20);
|
||||||
|
|
@ -1730,8 +1758,14 @@ describe('Store', () => {
|
||||||
|
|
||||||
store.order.referralCorrelationId = referralCorrelationId;
|
store.order.referralCorrelationId = referralCorrelationId;
|
||||||
store.order.parentAccountNumber = parentAccountNumber;
|
store.order.parentAccountNumber = parentAccountNumber;
|
||||||
store.order.currentDeductible = currentDeductible;
|
store.order.currentDeductible = {
|
||||||
store.order.originalDeductible = originalDeductible;
|
replace: currentDeductible,
|
||||||
|
repair: currentDeductible
|
||||||
|
};
|
||||||
|
store.order.originalDeductible = {
|
||||||
|
replace: originalDeductible,
|
||||||
|
repair: originalDeductible
|
||||||
|
};
|
||||||
store.order.policy.status = status;
|
store.order.policy.status = status;
|
||||||
store.order.customer.address.state = policyState;
|
store.order.customer.address.state = policyState;
|
||||||
store.order.damage.isRepair = isRepair;
|
store.order.damage.isRepair = isRepair;
|
||||||
|
|
@ -1827,8 +1861,14 @@ describe('Store', () => {
|
||||||
|
|
||||||
store.order.referralCorrelationId = referralCorrelationId;
|
store.order.referralCorrelationId = referralCorrelationId;
|
||||||
store.order.parentAccountNumber = parentAccountNumber;
|
store.order.parentAccountNumber = parentAccountNumber;
|
||||||
store.order.currentDeductible = currentDeductible;
|
store.order.currentDeductible = {
|
||||||
store.order.originalDeductible = originalDeductible;
|
replace: currentDeductible,
|
||||||
|
repair: currentDeductible
|
||||||
|
};
|
||||||
|
store.order.originalDeductible = {
|
||||||
|
replace: originalDeductible,
|
||||||
|
repair: originalDeductible
|
||||||
|
};
|
||||||
store.order.policy.status = status;
|
store.order.policy.status = status;
|
||||||
store.order.customer.address.state = policyState;
|
store.order.customer.address.state = policyState;
|
||||||
store.order.policy.endorsementQuestionAnswers = endorsementAnswers;
|
store.order.policy.endorsementQuestionAnswers = endorsementAnswers;
|
||||||
|
|
@ -1898,23 +1938,29 @@ describe('Store', () => {
|
||||||
describe('updateDeductible method', () => {
|
describe('updateDeductible method', () => {
|
||||||
it('final deductible is saved as currentDeductible in store', () => {
|
it('final deductible is saved as currentDeductible in store', () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const finalDeductible = getRandomInt(0, 5000);
|
store.order.damage.isRepair = false;
|
||||||
|
const deductibleInfo = {
|
||||||
|
deductible: 500
|
||||||
|
};
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
store.updateDeductible(finalDeductible);
|
store.updateDeductible(deductibleInfo);
|
||||||
|
|
||||||
// Assert
|
// 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', () => {
|
it('null final deductible => currentDeductible in store set to null', () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const finalDeductible = null;
|
store.order.damage.isRepair = false;
|
||||||
|
const deductibleInfo = {
|
||||||
|
deductible: null
|
||||||
|
};
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
store.updateDeductible(finalDeductible);
|
store.updateDeductible(deductibleInfo);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(store.order.currentDeductible).toEqual(finalDeductible);
|
expect(store.order.currentDeductible.replace).toEqual(deductibleInfo.deductible);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,15 +6,18 @@
|
||||||
//Define colors for namespaced classes
|
//Define colors for namespaced classes
|
||||||
$header-background: #ffd100;
|
$header-background: #ffd100;
|
||||||
$accent-fill: #e6f1f3; // Calendar background
|
$accent-fill: #e6f1f3; // Calendar background
|
||||||
$accent-color: #09748b;
|
$accent-color: #0070d1;
|
||||||
$link: #09748b;
|
$link: #0070d1;
|
||||||
$svg-fill-color: '%2309748b'; // Color of calendar icon. Place HEX code *after* %23
|
$svg-fill-color: '%2309748b'; // Color of calendar icon. Place HEX code *after* %23
|
||||||
$progress-bar-success-color: #1a1446;
|
$progress-bar-success-color: #1a1446;
|
||||||
$progress-bar-background-color: #ffffff;
|
$progress-bar-background-color: #ffffff;
|
||||||
|
|
||||||
|
a,
|
||||||
svg,
|
svg,
|
||||||
.modal-text {
|
.modal-text {
|
||||||
fill: $accent-color;
|
fill: $accent-color;
|
||||||
|
color: $accent-color;
|
||||||
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
.container-fluid {
|
.container-fluid {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue