Merge pull request #1086 from Safelite/feature/INSR-8325
INSR-8325: coverage statement defects
This commit is contained in:
commit
ecfca89d06
3 changed files with 31 additions and 3 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
exports[`coverageStatement.vue returns the initial data 1`] = `
|
exports[`coverageStatement.vue returns the initial data 1`] = `
|
||||||
Object {
|
Object {
|
||||||
|
"CANCEL_CLAIM_REF_NAME": "CancelClaimModal",
|
||||||
"RECAL_MODAL_REF_NAME": "RecalModal",
|
"RECAL_MODAL_REF_NAME": "RecalModal",
|
||||||
"baseServiceLineItems": Array [],
|
"baseServiceLineItems": Array [],
|
||||||
"widget": Object {
|
"widget": Object {
|
||||||
|
|
|
||||||
|
|
@ -98,6 +98,7 @@ 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();
|
||||||
return { wrapper };
|
return { wrapper };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -672,6 +673,18 @@ describe('coverageStatement.vue', () => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
describe('openCancelClaimModal', () => {
|
||||||
|
test('when I want to cancel link is clicked, modal opens', () => {
|
||||||
|
// Arrange
|
||||||
|
const { wrapper } = getMountedComponent({});
|
||||||
|
|
||||||
|
// Act
|
||||||
|
wrapper.vm.openCancelClaimModal();
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(wrapper.vm.$refs[CANCEL_CLAIM_REF_NAME].openModal).toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
describe('claim registration api call', () => {
|
describe('claim registration api call', () => {
|
||||||
it('Loaded duplicate with previously registered claim => claim registration is not called', async () => {
|
it('Loaded duplicate with previously registered claim => claim registration is not called', async () => {
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@
|
||||||
linkType="text"
|
linkType="text"
|
||||||
text="No, I want to cancel"
|
text="No, I want to cancel"
|
||||||
href="#"
|
href="#"
|
||||||
@clickEvent="cancelClaim" />
|
@clickEvent="openCancelClaimModal" />
|
||||||
<textBlock
|
<textBlock
|
||||||
v-if="isDisclaimerVisible"
|
v-if="isDisclaimerVisible"
|
||||||
class="mt-5 mb-5"
|
class="mt-5 mb-5"
|
||||||
|
|
@ -100,6 +100,10 @@
|
||||||
:ref="RECAL_MODAL_REF_NAME"
|
:ref="RECAL_MODAL_REF_NAME"
|
||||||
cssModalHeadlineClass="text-center"
|
cssModalHeadlineClass="text-center"
|
||||||
cmsWidgetName="RecalModal" />
|
cmsWidgetName="RecalModal" />
|
||||||
|
<cancelClaimModal
|
||||||
|
:ref="CANCEL_CLAIM_REF_NAME"
|
||||||
|
@cancelClaimConfirmation="cancelClaim"
|
||||||
|
@returnToClaim="navigateForward" />
|
||||||
</Form>
|
</Form>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -108,6 +112,7 @@
|
||||||
import { Form } from 'vee-validate';
|
import { Form } from 'vee-validate';
|
||||||
import siteHeader from '@/iss-components/site-header/site-header.vue';
|
import siteHeader from '@/iss-components/site-header/site-header.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 cancelClaimModal from '@/layouts/coverage-statement/cancel-claim-modal/cancel-claim-modal.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 textLink from '@/ux-components/text-link/text-link.vue';
|
||||||
import buttonMain from '@/ux-components/button-main/button-main.vue';
|
import buttonMain from '@/ux-components/button-main/button-main.vue';
|
||||||
|
|
@ -134,6 +139,7 @@ import coverageStatuses from '@/constants/coverage-statuses';
|
||||||
import coverageType from '@/constants/coverage-type';
|
import coverageType from '@/constants/coverage-type';
|
||||||
|
|
||||||
const RECAL_MODAL_REF_NAME = 'RecalModal';
|
const RECAL_MODAL_REF_NAME = 'RecalModal';
|
||||||
|
const CANCEL_CLAIM_REF_NAME = 'CancelClaimModal';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'coverage-statement',
|
name: 'coverage-statement',
|
||||||
|
|
@ -144,7 +150,8 @@ export default {
|
||||||
buttonMain,
|
buttonMain,
|
||||||
textBlock,
|
textBlock,
|
||||||
textLink,
|
textLink,
|
||||||
siteFooter
|
siteFooter,
|
||||||
|
cancelClaimModal
|
||||||
},
|
},
|
||||||
mixins: [baseFormMixin, vehicleQuestionsMixin],
|
mixins: [baseFormMixin, vehicleQuestionsMixin],
|
||||||
async beforeRouteEnter(to, from, next) {
|
async beforeRouteEnter(to, from, next) {
|
||||||
|
|
@ -205,7 +212,8 @@ export default {
|
||||||
explanatoryText: 'ExplanatoryTextWidget',
|
explanatoryText: 'ExplanatoryTextWidget',
|
||||||
nextStep: 'NextStepsWidget'
|
nextStep: 'NextStepsWidget'
|
||||||
},
|
},
|
||||||
RECAL_MODAL_REF_NAME
|
RECAL_MODAL_REF_NAME,
|
||||||
|
CANCEL_CLAIM_REF_NAME
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -444,6 +452,9 @@ export default {
|
||||||
this.baseServiceLineItems = lineItems;
|
this.baseServiceLineItems = lineItems;
|
||||||
},
|
},
|
||||||
formatAmountInDollars,
|
formatAmountInDollars,
|
||||||
|
openCancelClaimModal() {
|
||||||
|
this.$refs[CANCEL_CLAIM_REF_NAME].openModal();
|
||||||
|
},
|
||||||
cancelClaim() {
|
cancelClaim() {
|
||||||
this.mainStore.updateIsSafeliteProvider(false);
|
this.mainStore.updateIsSafeliteProvider(false);
|
||||||
this.mainStore.setBailout(bailoutMessage.RequestCallback());
|
this.mainStore.setBailout(bailoutMessage.RequestCallback());
|
||||||
|
|
@ -531,6 +542,9 @@ export default {
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
margin-top: 6px;
|
margin-top: 6px;
|
||||||
|
.external-text {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
a {
|
a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue