Added unit test for non-standard ISO date format passing to make sure dateofloss disabled flag is not set.
This commit is contained in:
parent
5e686581db
commit
a1ed368ce4
1 changed files with 16 additions and 0 deletions
|
|
@ -224,4 +224,20 @@ describe('entry-page.vue', () => {
|
||||||
expect(wrapper.vm.mainStore.issConfig.successReturnURL).toBe('http://success');
|
expect(wrapper.vm.mainStore.issConfig.successReturnURL).toBe('http://success');
|
||||||
expect(wrapper.vm.mainStore.issConfig.failureReturnURL).toBe('http://fail');
|
expect(wrapper.vm.mainStore.issConfig.failureReturnURL).toBe('http://fail');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('does not populate date of loss when dateofloss is not ISO formatted', () => {
|
||||||
|
const mainInitialState = {
|
||||||
|
issConfig: { disabledFields: { dateOfLoss: false } },
|
||||||
|
order: { policy: { dateOfLoss: '2021-12-31' } }
|
||||||
|
};
|
||||||
|
const params = {
|
||||||
|
dateofloss: 'not-a-date'
|
||||||
|
};
|
||||||
|
|
||||||
|
const { wrapper } = getMountedComponent(mainInitialState);
|
||||||
|
wrapper.vm.populateStoreItemsFromParams(params);
|
||||||
|
|
||||||
|
expect(wrapper.vm.mainStore.order.policy.dateOfLoss).toBe('2021-12-31');
|
||||||
|
expect(wrapper.vm.mainStore.issConfig.disabledFields.dateOfLoss).toBe(false);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue