diff --git a/src/store/index.js b/src/store/index.js index 7f5ed853..fe335f26 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -469,6 +469,7 @@ export const useMainStore = defineStore({ }, (error) => { this.order.payment.insuranceCoverage.isVerified = false; this.order.payment.insuranceCoverage.coverageStatus = coverageStatuses.PENDING; + this.order.payment.insuranceCoverage.claimNumber = null; return reject(error); }); }); diff --git a/src/store/store.spec.js b/src/store/store.spec.js index 9ada327b..895c7e0d 100644 --- a/src/store/store.spec.js +++ b/src/store/store.spec.js @@ -396,6 +396,7 @@ describe('Store', () => { expect(globalMethods.callHttpClient).toHaveBeenCalled(); expect(store.payment.insuranceCoverage.isVerified).toBe(true); expect(store.payment.insuranceCoverage.coverageStatus).toBe(coverageStatuses.NO_COMP); + expect(store.payment.insuranceCoverage.claimNumber).toBe(null); }); it('successful response with coverage => isVerified true and coverage status verified', async () => { @@ -422,11 +423,12 @@ describe('Store', () => { expect(globalMethods.callHttpClient).toHaveBeenCalled(); expect(store.payment.insuranceCoverage.isVerified).toBe(true); expect(store.payment.insuranceCoverage.coverageStatus).toBe(coverageStatuses.VERIFIED); + expect(store.payment.insuranceCoverage.claimNumber).toBe(response.data.claimNumber); }); it('Call to client returns exception, resulting in object with error property being returned', async () => { // Arrange - expect.assertions(4); + expect.assertions(5); const error = 'this is the error'; globalMethods.callHttpClient = jest.fn().mockReturnValue(Promise.reject(error)); @@ -439,6 +441,7 @@ describe('Store', () => { expect(globalMethods.callHttpClient).toHaveBeenCalled(); expect(store.payment.insuranceCoverage.isVerified).toBe(false); expect(store.payment.insuranceCoverage.coverageStatus).toBe(coverageStatuses.PENDING); + expect(store.payment.insuranceCoverage.claimNumber).toBe(null); }); }); @@ -645,7 +648,8 @@ describe('Store', () => { policyFirstName: customer.firstName, policyLastName: customer.lastName, policyPhoneNumber: customer.phoneNumber, - policyEmail: customer.emailAddress + policyEmail: customer.emailAddress, + policyState: customer.address.state }), policyNumber: policy.policyNumber, policyZipCode: policy.policyZipCode,