Merge pull request #505 from Safelite/feature/SSR-862
fix to unverified flow
This commit is contained in:
commit
d6249dfed4
2 changed files with 38 additions and 8 deletions
|
|
@ -367,6 +367,37 @@ describe.skip('coverageStatement.vue', () => {
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(wrapper.vm.verifiedDeductible).toBeFalsy();
|
||||||
|
});
|
||||||
|
test('If deductible is null, verifiedDeductible returns false', () => {
|
||||||
|
const sellingPrice = getRandomInt(100, 500);
|
||||||
|
const deductible = null;
|
||||||
|
const mainInitialState = {
|
||||||
|
order: {
|
||||||
|
damage: {
|
||||||
|
isRepair: true
|
||||||
|
},
|
||||||
|
policy: {
|
||||||
|
noCoverage: false,
|
||||||
|
deductible: {
|
||||||
|
repair: deductible
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const { wrapper } = getMountedComponent(mainInitialState);
|
||||||
|
wrapper.setData({
|
||||||
|
availableLineItems: [
|
||||||
|
{
|
||||||
|
sellingPrice,
|
||||||
|
kitPrice: 0,
|
||||||
|
laborAmount: 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(wrapper.vm.verifiedDeductible).toBeFalsy();
|
expect(wrapper.vm.verifiedDeductible).toBeFalsy();
|
||||||
});
|
});
|
||||||
|
|
@ -747,7 +778,7 @@ describe.skip('coverageStatement.vue', () => {
|
||||||
expect(wrapper.vm.mainStore.registerClaim).not.toHaveBeenCalled();
|
expect(wrapper.vm.mainStore.registerClaim).not.toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it.only('claim registration required => register claim method called', async () => {
|
it('claim registration required => register claim method called', async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const sellingPrice = getRandomInt(50, 100);
|
const sellingPrice = getRandomInt(50, 100);
|
||||||
const deductible = sellingPrice - 1;
|
const deductible = sellingPrice - 1;
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,6 @@ export default {
|
||||||
// Call APIs
|
// Call APIs
|
||||||
const cmsContentPromise = fetchCmsContentForPage(to?.query?.issPage);
|
const cmsContentPromise = fetchCmsContentForPage(to?.query?.issPage);
|
||||||
const supportingItemsPromise = await useMainStore().getSupportingItems();
|
const supportingItemsPromise = await useMainStore().getSupportingItems();
|
||||||
const finalDeductiblePromise = await useMainStore().getFinalDeductible();
|
|
||||||
|
|
||||||
// Settle promises and get results
|
// Settle promises and get results
|
||||||
const promiseResultMap = [
|
const promiseResultMap = [
|
||||||
|
|
@ -158,10 +157,6 @@ export default {
|
||||||
{
|
{
|
||||||
resultKey: 'supportingItems',
|
resultKey: 'supportingItems',
|
||||||
promise: supportingItemsPromise
|
promise: supportingItemsPromise
|
||||||
},
|
|
||||||
{
|
|
||||||
resultKey: 'finalDeductible',
|
|
||||||
promise: finalDeductiblePromise
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -174,7 +169,11 @@ export default {
|
||||||
...(clonedGlassParts ?? [])
|
...(clonedGlassParts ?? [])
|
||||||
];
|
];
|
||||||
|
|
||||||
const pricingResults = await useMainStore().getPriceOrderItems(availableLineItems);
|
let pricingResults = [];
|
||||||
|
if (useMainStore().order.policy.policyLookupSuccessful) {
|
||||||
|
pricingResults = await useMainStore().getPriceOrderItems(availableLineItems);
|
||||||
|
await useMainStore().getFinalDeductible();
|
||||||
|
}
|
||||||
|
|
||||||
// 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) => {
|
||||||
|
|
@ -280,7 +279,7 @@ export default {
|
||||||
},
|
},
|
||||||
verifiedDeductible() {
|
verifiedDeductible() {
|
||||||
return useMainStore().isClaimRegistrationRequired
|
return useMainStore().isClaimRegistrationRequired
|
||||||
? this.registerClaimSuccessful && this.coveredAndServicePriceAboveOrEqualDeductible
|
? this.registerClaimSuccessful && this.coveredAndServicePriceAboveOrEqualDeductible && this.vehicleDeductible !== null
|
||||||
: this.policyLookupSuccessful && this.coveredAndServicePriceAboveOrEqualDeductible;
|
: this.policyLookupSuccessful && this.coveredAndServicePriceAboveOrEqualDeductible;
|
||||||
},
|
},
|
||||||
unverified() {
|
unverified() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue