Fixing bugs with coverage statement
This commit is contained in:
parent
ef410f4fcb
commit
76d909908e
8 changed files with 155 additions and 112 deletions
|
|
@ -5,6 +5,14 @@ import { getMountOptions } from '@/helpers/unit-test-helper.js';
|
||||||
jest.mock('@/assets/img/loader.gif', () => 'loader.gif');
|
jest.mock('@/assets/img/loader.gif', () => 'loader.gif');
|
||||||
jest.mock('@/assets/img/windshield.png', () => 'windshield.png');
|
jest.mock('@/assets/img/windshield.png', () => 'windshield.png');
|
||||||
|
|
||||||
|
function setupMocks() {
|
||||||
|
const mountOptions = getMountOptions({
|
||||||
|
});
|
||||||
|
|
||||||
|
const wrapper = shallowMount(loadingModal, mountOptions);
|
||||||
|
return { wrapper };
|
||||||
|
}
|
||||||
|
|
||||||
describe('loadingModal', () => {
|
describe('loadingModal', () => {
|
||||||
test('showModal sets modal visible', async () => {
|
test('showModal sets modal visible', async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
|
|
@ -18,12 +26,16 @@ describe('loadingModal', () => {
|
||||||
expect(wrapper.vm.isModalVisible).toEqual(true);
|
expect(wrapper.vm.isModalVisible).toEqual(true);
|
||||||
wrapper.unmount();
|
wrapper.unmount();
|
||||||
});
|
});
|
||||||
});
|
test('hideModal sets modal invisible', async () => {
|
||||||
|
// Arrange
|
||||||
|
const { wrapper } = setupMocks();
|
||||||
|
wrapper.vm.isModalVisible = true;
|
||||||
|
|
||||||
function setupMocks() {
|
// Act
|
||||||
const mountOptions = getMountOptions({
|
wrapper.vm.hideModal();
|
||||||
});
|
|
||||||
|
|
||||||
const wrapper = shallowMount(loadingModal, mountOptions);
|
// Assert
|
||||||
return { wrapper };
|
expect(wrapper.vm.isModalVisible).toEqual(false);
|
||||||
}
|
wrapper.unmount();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,16 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="text-container slide">
|
<div class="text-container slide">
|
||||||
<p>
|
<p
|
||||||
|
v-for="text in textSlides"
|
||||||
|
:key="text">
|
||||||
|
{{ text }}
|
||||||
|
<span class="dot-1">.</span>
|
||||||
|
<span class="dot-2">.</span>
|
||||||
|
<span class="dot-3">.</span>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<!-- <p>
|
||||||
Finding shops near you
|
Finding shops near you
|
||||||
<span class="dot-1">.</span>
|
<span class="dot-1">.</span>
|
||||||
<span class="dot-2">.</span>
|
<span class="dot-2">.</span>
|
||||||
|
|
@ -41,7 +50,7 @@
|
||||||
<span class="dot-1">.</span>
|
<span class="dot-1">.</span>
|
||||||
<span class="dot-2">.</span>
|
<span class="dot-2">.</span>
|
||||||
<span class="dot-3">.</span>
|
<span class="dot-3">.</span>
|
||||||
</p>
|
</p> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -52,7 +61,10 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'Modal',
|
name: 'loading-modal',
|
||||||
|
props: {
|
||||||
|
textSlides: Array
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isModalVisible: false
|
isModalVisible: false
|
||||||
|
|
@ -74,6 +86,9 @@ export default {
|
||||||
},
|
},
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
},
|
||||||
|
hideModal() {
|
||||||
|
this.isModalVisible = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="`page-container-grouped-styles questions-page`">
|
<div :class="`page-container-grouped-styles questions-page`">
|
||||||
<div class="fade-on-route-transition position-relative">
|
<div class="fade-on-route-transition position-relative">
|
||||||
<loadingModal ref="loadingModal" />
|
<loadingModal
|
||||||
|
ref="loadingModal"
|
||||||
|
:textSlides="loadingText" />
|
||||||
<siteHeader cmsWidgetName="SiteHeaderWidget" />
|
<siteHeader cmsWidgetName="SiteHeaderWidget" />
|
||||||
<div class="select-car">
|
<div class="select-car">
|
||||||
<div class="container-fluid pb-2">
|
<div class="container-fluid pb-2">
|
||||||
|
|
@ -52,7 +54,7 @@ import alert from '@/ux-components/alert/alert';
|
||||||
import questionChain from '@/digital-components/question-chain/question-chain';
|
import questionChain from '@/digital-components/question-chain/question-chain';
|
||||||
import siteSubHeader from '@/iss-components/site-sub-header/site-sub-header';
|
import siteSubHeader from '@/iss-components/site-sub-header/site-sub-header';
|
||||||
import siteFooter from '@/iss-components/site-footer/site-footer';
|
import siteFooter from '@/iss-components/site-footer/site-footer';
|
||||||
import loadingModal from '@/iss-components/loading-modal/loading-modal.vue';
|
import loadingModal from '@/iss-components/loading-modal/loading-modal';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'questions-page',
|
name: 'questions-page',
|
||||||
|
|
@ -63,6 +65,7 @@ export default {
|
||||||
questionsData: Array,
|
questionsData: Array,
|
||||||
validationRules: String,
|
validationRules: String,
|
||||||
modelValue: Object,
|
modelValue: Object,
|
||||||
|
loadingText: Array,
|
||||||
index: Number
|
index: Number
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,9 @@
|
||||||
@invalidSubmit="onInvalidSubmit">
|
@invalidSubmit="onInvalidSubmit">
|
||||||
<div class="page-container-grouped-styles">
|
<div class="page-container-grouped-styles">
|
||||||
<div class="fade-on-route-transition position-relative">
|
<div class="fade-on-route-transition position-relative">
|
||||||
|
<loadingModal
|
||||||
|
ref="loadingModal"
|
||||||
|
:textSlides="loadingText" />
|
||||||
<siteHeader cmsWidgetName="SiteHeaderWidget" />
|
<siteHeader cmsWidgetName="SiteHeaderWidget" />
|
||||||
<div class="select-car">
|
<div class="select-car">
|
||||||
<div class="container-fluid pb-2">
|
<div class="container-fluid pb-2">
|
||||||
|
|
@ -102,6 +105,7 @@ import recalModal from '@/layouts/coverage-statement/recal-modal/recal-modal';
|
||||||
import alert from '@/ux-components/alert/alert';
|
import alert from '@/ux-components/alert/alert';
|
||||||
import contentGroupModal from '@/iss-components/content-group-modal/content-group-modal';
|
import contentGroupModal from '@/iss-components/content-group-modal/content-group-modal';
|
||||||
import buttonQuestion from '@/digital-components/button-question/button-question';
|
import buttonQuestion from '@/digital-components/button-question/button-question';
|
||||||
|
import loadingModal from '@/iss-components/loading-modal/loading-modal';
|
||||||
|
|
||||||
// Import Supporting Files
|
// Import Supporting Files
|
||||||
import { fetchCmsContentForPage, setupModalLinks, processIfStatements } from '@/helpers/cms-content-helper.js';
|
import { fetchCmsContentForPage, setupModalLinks, processIfStatements } from '@/helpers/cms-content-helper.js';
|
||||||
|
|
@ -124,10 +128,11 @@ export default {
|
||||||
recalModal,
|
recalModal,
|
||||||
alert,
|
alert,
|
||||||
contentGroupModal,
|
contentGroupModal,
|
||||||
buttonQuestion
|
buttonQuestion,
|
||||||
|
loadingModal
|
||||||
},
|
},
|
||||||
mixins: [baseFormMixin, vehicleQuestionsMixin],
|
mixins: [baseFormMixin, vehicleQuestionsMixin],
|
||||||
async beforeRouteEnter(to, from, next) {
|
async beforeRouteEnter(to, _from, next) {
|
||||||
// Call APIs
|
// Call APIs
|
||||||
const cmsContentPromise = fetchCmsContentForPage(to.query.issPage);
|
const cmsContentPromise = fetchCmsContentForPage(to.query.issPage);
|
||||||
|
|
||||||
|
|
@ -145,18 +150,7 @@ export default {
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
if (useMainStore().policy.policyLookupSuccessful
|
|
||||||
&& useMainStore().isClaimRegistrationRequired
|
|
||||||
&& !useMainStore().policy.noCoverage) {
|
|
||||||
const registerClaimResponse = await useMainStore().registerClaim();
|
|
||||||
promiseResultMap.push({
|
|
||||||
resultKey: 'registerClaim',
|
|
||||||
promise: registerClaimResponse
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const resultMap = await settleAllPromises(promiseResultMap);
|
const resultMap = await settleAllPromises(promiseResultMap);
|
||||||
|
|
||||||
const clonedGlassParts = store.order.lineItems.glassParts
|
const clonedGlassParts = store.order.lineItems.glassParts
|
||||||
? JSON.parse(JSON.stringify(store.order.lineItems.glassParts))
|
? JSON.parse(JSON.stringify(store.order.lineItems.glassParts))
|
||||||
: [];
|
: [];
|
||||||
|
|
@ -170,19 +164,21 @@ export default {
|
||||||
// Call the "next" function to complete the transition to this page.
|
// Call the "next" function to complete the transition to this page.
|
||||||
next((vm) => {
|
next((vm) => {
|
||||||
vm.setCmsContent(resultMap.cmsContent);
|
vm.setCmsContent(resultMap.cmsContent);
|
||||||
vm.pricedGlassParts = clonedGlassParts;
|
|
||||||
vm.supportingItems = resultMap.supportingItems;
|
|
||||||
vm.availableLineItems = pricingResults;
|
vm.availableLineItems = pricingResults;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isVerified: store.order.payment.insuranceCoverage.isVerified,
|
isVerified: store.order.payment.insuranceCoverage.isVerified,
|
||||||
supportingItems: [],
|
|
||||||
pricedGlassParts: [],
|
|
||||||
availableLineItems: [],
|
availableLineItems: [],
|
||||||
selectedProvider: '',
|
selectedProvider: '',
|
||||||
deductibleText: 'Your deductible is:',
|
deductibleText: 'Your deductible is:',
|
||||||
|
isLoading: true,
|
||||||
|
loadingText: [
|
||||||
|
'Connecting to your insurance company',
|
||||||
|
'Nearly there',
|
||||||
|
'Finishing up'
|
||||||
|
],
|
||||||
rules: {
|
rules: {
|
||||||
selectionRequired: globalRules.OPTION_REQUIRED
|
selectionRequired: globalRules.OPTION_REQUIRED
|
||||||
}
|
}
|
||||||
|
|
@ -249,22 +245,16 @@ export default {
|
||||||
return this.getDeductibleString(this.vehicleDeductible);
|
return this.getDeductibleString(this.vehicleDeductible);
|
||||||
},
|
},
|
||||||
isDeductibleZero() {
|
isDeductibleZero() {
|
||||||
if (this.coverageVerified && this.verifiedDeductible) {
|
return this.verifiedDeductible && this.vehicleDeductible === 0;
|
||||||
return this.vehicleDeductible === 0;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
},
|
},
|
||||||
deductibleOverZero() {
|
deductibleOverZero() {
|
||||||
if (this.coverageVerified && this.verifiedDeductible) {
|
return this.verifiedDeductible && !this.isDeductibleZero;
|
||||||
return !this.isDeductibleZero;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
},
|
},
|
||||||
coverageVerified() {
|
coverageVerified() {
|
||||||
return this.isVerified;
|
return useMainStore().order.policy.policyLookupSuccessful;
|
||||||
},
|
},
|
||||||
coverageUnverified() {
|
coverageUnverified() {
|
||||||
return !this.isVerified;
|
return !this.coverageVerified;
|
||||||
},
|
},
|
||||||
verifiedNoComp() {
|
verifiedNoComp() {
|
||||||
return this.coverageVerified ? store.order.policy.noCoverage : false;
|
return this.coverageVerified ? store.order.policy.noCoverage : false;
|
||||||
|
|
@ -331,7 +321,19 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.$refs.loadingModal.showModal();
|
||||||
setupModalLinks(this);
|
setupModalLinks(this);
|
||||||
|
const vm = this;
|
||||||
|
if (useMainStore().policy.coverageVerified
|
||||||
|
&& useMainStore().isClaimRegistrationRequired
|
||||||
|
&& !useMainStore().policy.noCoverage) {
|
||||||
|
useMainStore().registerClaim().then((r) => {
|
||||||
|
vm.$refs.loadingModal.hideModal();
|
||||||
|
return r;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
vm.$refs.loadingModal.hideModal();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
arePagePrerequisitesValid() {
|
arePagePrerequisitesValid() {
|
||||||
|
|
@ -344,7 +346,7 @@ export default {
|
||||||
return this.navigateForward();
|
return this.navigateForward();
|
||||||
},
|
},
|
||||||
async navigateForward() {
|
async navigateForward() {
|
||||||
if (this.coverageUnverified || this.verifiedDeductible) {
|
if (!this.coverageVerified || this.verifiedDeductible) {
|
||||||
this.$router.navigate(this.navigationScenarios.CLICKED_FORWARD,
|
this.$router.navigate(this.navigationScenarios.CLICKED_FORWARD,
|
||||||
this.$route);
|
this.$route);
|
||||||
} else if (this.verifiedITAC || this.verifiedNoComp) {
|
} else if (this.verifiedITAC || this.verifiedNoComp) {
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,7 @@
|
||||||
<siteHeader cmsWidgetName="SiteHeaderWidget" />
|
<siteHeader cmsWidgetName="SiteHeaderWidget" />
|
||||||
<siteSubHeader cmsWidgetName="SiteSubHeaderWidget"
|
<siteSubHeader cmsWidgetName="SiteSubHeaderWidget"
|
||||||
justification="left"
|
justification="left"
|
||||||
issContainingPage="service-packages"
|
issContainingPage="service-packages" />
|
||||||
/>
|
|
||||||
<div class="mx-5">
|
<div class="mx-5">
|
||||||
<servicePackageQuestion ref="servicePackage"
|
<servicePackageQuestion ref="servicePackage"
|
||||||
cmsWidgetName="ServicePackage"
|
cmsWidgetName="ServicePackage"
|
||||||
|
|
@ -25,7 +24,9 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<loadingModal ref="loadingModal" />
|
<loadingModal
|
||||||
|
ref="loadingModal"
|
||||||
|
:textSlides="loadingText" />
|
||||||
<contentGroupModal ref="RainDefenseModal" cmsWidgetName="RainDefenseModal" />
|
<contentGroupModal ref="RainDefenseModal" cmsWidgetName="RainDefenseModal" />
|
||||||
<contentGroupModal ref="FrontWiperModal" cmsWidgetName="FrontWiperModal" />
|
<contentGroupModal ref="FrontWiperModal" cmsWidgetName="FrontWiperModal" />
|
||||||
<contentGroupModal ref="RearWiperModal" cmsWidgetName="RearWiperModal" />
|
<contentGroupModal ref="RearWiperModal" cmsWidgetName="RearWiperModal" />
|
||||||
|
|
@ -112,6 +113,13 @@ export default {
|
||||||
availableLineItems: [],
|
availableLineItems: [],
|
||||||
supportingItems: [],
|
supportingItems: [],
|
||||||
pricedGlassParts: [],
|
pricedGlassParts: [],
|
||||||
|
loadingText: [
|
||||||
|
'Finding shops near you',
|
||||||
|
'Looking for dates',
|
||||||
|
'Searching for times',
|
||||||
|
'Nearly there',
|
||||||
|
'Finishing up'
|
||||||
|
],
|
||||||
rules: {
|
rules: {
|
||||||
optionRequired: globalRules.OPTION_REQUIRED
|
optionRequired: globalRules.OPTION_REQUIRED
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,6 @@ export default {
|
||||||
forwardButtonAction() {
|
forwardButtonAction() {
|
||||||
switch (this.selectedVinLookupMethod) {
|
switch (this.selectedVinLookupMethod) {
|
||||||
case vinLookupMethodSelections.MANUALVIN:
|
case vinLookupMethodSelections.MANUALVIN:
|
||||||
useMainStore().updateVehicleVin(null);
|
|
||||||
this.$router.navigate(this.navigationScenarios.SELECTED_MANUAL_VIN, this.$route);
|
this.$router.navigate(this.navigationScenarios.SELECTED_MANUAL_VIN, this.$route);
|
||||||
break;
|
break;
|
||||||
case vinLookupMethodSelections.LICENSEPLATE:
|
case vinLookupMethodSelections.LICENSEPLATE:
|
||||||
|
|
|
||||||
|
|
@ -159,7 +159,7 @@ export default {
|
||||||
// because the form itself actually passes its client-side validation.
|
// because the form itself actually passes its client-side validation.
|
||||||
// SSR-189 Scenario #4.
|
// SSR-189 Scenario #4.
|
||||||
this.$refs.siteFooter.enableForwardAction();
|
this.$refs.siteFooter.enableForwardAction();
|
||||||
this.bailout = true
|
this.bailout = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.bailout) {
|
if (this.bailout) {
|
||||||
|
|
@ -190,8 +190,8 @@ export default {
|
||||||
|
|
||||||
let isSelectedGlassAvailableForVehicle = true;
|
let isSelectedGlassAvailableForVehicle = true;
|
||||||
if (this.isCarIdDifferentFromTheStore) {
|
if (this.isCarIdDifferentFromTheStore) {
|
||||||
isSelectedGlassAvailableForVehicle =
|
isSelectedGlassAvailableForVehicle
|
||||||
await isGlassAvailableForCarId(this.vehicleFromLookup.carId);
|
= await isGlassAvailableForCarId(this.vehicleFromLookup.carId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// navigate back to vehicle-damage
|
// navigate back to vehicle-damage
|
||||||
|
|
|
||||||
|
|
@ -381,7 +381,8 @@ export const useMainStore = defineStore({
|
||||||
// TODO: replace place holder correlationId with the real thing
|
// TODO: replace place holder correlationId with the real thing
|
||||||
const placeHolderCorrelationId = '00000000-0000-0000-0000-000000000000';
|
const placeHolderCorrelationId = '00000000-0000-0000-0000-000000000000';
|
||||||
const nonNumberCharRegex = /[^0-9]/g;
|
const nonNumberCharRegex = /[^0-9]/g;
|
||||||
const order = this.order;
|
const { order } = this;
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
globalMethods.callHttpClient({
|
globalMethods.callHttpClient({
|
||||||
method: endpoints.RegisterClaim.method,
|
method: endpoints.RegisterClaim.method,
|
||||||
endpoint: endpoints.RegisterClaim.url,
|
endpoint: endpoints.RegisterClaim.url,
|
||||||
|
|
@ -443,9 +444,12 @@ export const useMainStore = defineStore({
|
||||||
} else {
|
} else {
|
||||||
this.order.payment.insuranceCoverage.coverageStatus = coverageStatuses.VERIFIED;
|
this.order.payment.insuranceCoverage.coverageStatus = coverageStatuses.VERIFIED;
|
||||||
}
|
}
|
||||||
|
return resolve(response);
|
||||||
}, (error) => {
|
}, (error) => {
|
||||||
this.order.payment.insuranceCoverage.isVerified = false;
|
this.order.payment.insuranceCoverage.isVerified = false;
|
||||||
this.order.payment.insuranceCoverage.coverageStatus = coverageStatuses.PENDING;
|
this.order.payment.insuranceCoverage.coverageStatus = coverageStatuses.PENDING;
|
||||||
|
return reject(error.response);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
async lookupVinByPlate(licensePlate, licenseState) {
|
async lookupVinByPlate(licensePlate, licenseState) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue