fix unit tests
This commit is contained in:
parent
bfb30c42b0
commit
b7aaca00e5
3 changed files with 21 additions and 34 deletions
|
|
@ -2,23 +2,13 @@
|
|||
|
||||
exports[`coverageStatement.vue returns the initial data 1`] = `
|
||||
Object {
|
||||
"CANCEL_CLAIM_REF_NAME": "CancelClaimModal",
|
||||
"DEDUCTIBLE_MODAL_REF_NAME": "DeductibleModal",
|
||||
"RECAL_MODAL_REF_NAME": "RecalModal",
|
||||
"SITE_FOOTER_REF_NAME": "siteFooter",
|
||||
"baseServiceLineItems": Array [],
|
||||
"deductibleText": "Your deductible is",
|
||||
"rules": Object {
|
||||
"selectionRequired": "option-required",
|
||||
},
|
||||
"selectedProvider": "",
|
||||
"widget": Object {
|
||||
"disclaimerText": "DisclaimerWidget",
|
||||
"explanatoryText": "ExplanatoryTextWidget",
|
||||
"nextStep": "NextStepsWidget",
|
||||
"serviceProviderQuestion": "ServiceProviderQuestion",
|
||||
"subheader": "SiteSubHeaderWidget",
|
||||
"verifiedItacAlert": "VerifiedITACAlert",
|
||||
},
|
||||
}
|
||||
`;
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ jest.mock('@/helpers/cms-content-helper', () => ({
|
|||
|
||||
jest.mock('@/helpers/text-helper', () => ({
|
||||
createOrderedListFromStringOfParagraphs: jest.fn(),
|
||||
createUnorderedListFromStringOfParagraphs: jest.fn(),
|
||||
formatAmountInDollars: jest.fn()
|
||||
}));
|
||||
|
||||
|
|
@ -98,9 +99,6 @@ function getMountedComponent(mainInitialState = {}, initialData = {}, methodToRu
|
|||
fetchCmsContentForPage.mockImplementation(() => Promise.resolve());
|
||||
|
||||
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 };
|
||||
}
|
||||
|
||||
|
|
@ -165,16 +163,6 @@ describe('coverageStatement.vue', () => {
|
|||
// Assert
|
||||
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.each([
|
||||
|
|
@ -373,7 +361,7 @@ describe('coverageStatement.vue', () => {
|
|||
[false, coverageStatuses.PENDING, coverageType.NO_COMP],
|
||||
[false, coverageStatuses.PENDING, coverageType.Deductible],
|
||||
[true, coverageStatuses.VERIFIED, coverageType.NO_COMP],
|
||||
[true, coverageStatuses.VERIFIED, coverageType.ITAC],
|
||||
[false, coverageStatuses.VERIFIED, coverageType.ITAC],
|
||||
[false, coverageStatuses.VERIFIED, coverageType.Deductible],
|
||||
[false, coverageStatuses.NO_COVERAGE, coverageType.NO_COMP],
|
||||
[false, coverageStatuses.NO_COVERAGE, coverageType.ITAC],
|
||||
|
|
@ -512,7 +500,10 @@ describe('coverageStatement.vue', () => {
|
|||
coverageStatus: coverageStatuses.PENDING,
|
||||
coverageType: coverageType.NONE
|
||||
},
|
||||
currentDeductible: null
|
||||
currentDeductible: {
|
||||
repair: null,
|
||||
replace: null
|
||||
}
|
||||
}
|
||||
};
|
||||
const { wrapper } = getMountedComponent(mainInitialState);
|
||||
|
|
@ -539,7 +530,9 @@ describe('coverageStatement.vue', () => {
|
|||
coverageStatus: coverageStatuses.VERIFIED,
|
||||
coverageType: coverageType.Deductible
|
||||
},
|
||||
currentDeductible: deductible
|
||||
currentDeductible: {
|
||||
replace: deductible
|
||||
}
|
||||
}
|
||||
};
|
||||
const { wrapper } = getMountedComponent(mainInitialState);
|
||||
|
|
@ -566,7 +559,9 @@ describe('coverageStatement.vue', () => {
|
|||
coverageStatus: coverageStatuses.VERIFIED,
|
||||
coverageType: coverageType.ITAC
|
||||
},
|
||||
currentDeductible: deductible
|
||||
currentDeductible: {
|
||||
replace: deductible
|
||||
}
|
||||
}
|
||||
};
|
||||
const { wrapper } = getMountedComponent(mainInitialState);
|
||||
|
|
@ -584,7 +579,7 @@ describe('coverageStatement.vue', () => {
|
|||
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
|
||||
const deductible = servicePrice + 1;
|
||||
const mainInitialState = {
|
||||
|
|
@ -596,7 +591,9 @@ describe('coverageStatement.vue', () => {
|
|||
coverageStatus: coverageStatuses.VERIFIED,
|
||||
coverageType: coverageType.ITAC
|
||||
},
|
||||
currentDeductible: deductible
|
||||
currentDeductible: {
|
||||
replace: deductible
|
||||
}
|
||||
}
|
||||
};
|
||||
const { wrapper } = getMountedComponent(mainInitialState);
|
||||
|
|
@ -605,7 +602,7 @@ describe('coverageStatement.vue', () => {
|
|||
});
|
||||
|
||||
// Act
|
||||
wrapper.vm.navigateForward();
|
||||
wrapper.vm.cancelClaim();
|
||||
|
||||
// Assert
|
||||
expect(wrapper.vm.$router.navigate)
|
||||
|
|
@ -667,7 +664,7 @@ describe('coverageStatement.vue', () => {
|
|||
});
|
||||
|
||||
// Act
|
||||
wrapper.vm.navigateForward();
|
||||
wrapper.vm.cancelClaim();
|
||||
|
||||
// Assert
|
||||
expect(wrapper.vm.$router.navigate)
|
||||
|
|
@ -776,7 +773,9 @@ describe('coverageStatement.vue', () => {
|
|||
vehicle: {
|
||||
policyVehicleId: 1
|
||||
},
|
||||
currentDeductible: deductible
|
||||
currentDeductible: {
|
||||
replace: deductible
|
||||
}
|
||||
},
|
||||
issConfig: {
|
||||
isClaimRegistrationRequired: true
|
||||
|
|
|
|||
|
|
@ -125,7 +125,6 @@ import settleAllPromises from '@/helpers/layout-helper.js';
|
|||
import { getDamageString } from '@/helpers/damage-helper.js';
|
||||
import { useMainStore } from '@/store/index.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 navigationScenarios from '@/router/router-constants/navigation-scenarios.js';
|
||||
import bailoutMessage from '@/constants/bailoutMessage';
|
||||
|
|
@ -205,7 +204,6 @@ export default {
|
|||
widget: {
|
||||
disclaimerText: 'DisclaimerWidget',
|
||||
subheader: 'SiteSubHeaderWidget',
|
||||
verifiedItacAlert: 'VerifiedITACAlert',
|
||||
explanatoryText: 'ExplanatoryTextWidget',
|
||||
nextStep: 'NextStepsWidget'
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue