Merge branch 'develop' of https://github.com/Safelite/DigitalConsumer.ISS into feature/digital/SSR-755
This commit is contained in:
commit
32e12ec672
2 changed files with 100 additions and 9 deletions
|
|
@ -546,10 +546,19 @@ export const useMainStore = defineStore({
|
||||||
status: this.order.policy.status,
|
status: this.order.policy.status,
|
||||||
currentDeductible: this.order.currentDeductible,
|
currentDeductible: this.order.currentDeductible,
|
||||||
noCoverage: this.order.policy.noCoverage,
|
noCoverage: this.order.policy.noCoverage,
|
||||||
isRepair: this.order.damage.isRepair
|
isRepair: this.order.damage.isRepair,
|
||||||
|
policyNumber: this.order.policy.policyNumber,
|
||||||
|
insuredFirstName: this.order.customer.firstName,
|
||||||
|
insuredLastName: this.order.customer.lastName,
|
||||||
|
insuredZipCode: this.order.customer.address.zipCode,
|
||||||
|
policyVehicleId: this.order.vehicle.policyVehicleId?.toString() ?? '',
|
||||||
|
vehicleVin: this.order.vehicle.vin,
|
||||||
|
policyData: this.order.policy.policyData,
|
||||||
|
isItac: this.order.policy.isITAC
|
||||||
}
|
}
|
||||||
}).then((r) => {
|
}).then((r) => {
|
||||||
this.updateDeductible(r.data);
|
this.order.policy.policyData = r.data.policyData;
|
||||||
|
this.updateDeductible(r.data.deductible);
|
||||||
return resolve(r);
|
return resolve(r);
|
||||||
}).catch((error) => reject(error));
|
}).catch((error) => reject(error));
|
||||||
});
|
});
|
||||||
|
|
@ -1173,7 +1182,8 @@ export const useMainStore = defineStore({
|
||||||
referralNumber: this.order.referralNumber?.toString(),
|
referralNumber: this.order.referralNumber?.toString(),
|
||||||
referralCorrelationId: this.order.referralCorrelationId,
|
referralCorrelationId: this.order.referralCorrelationId,
|
||||||
referralSequenceNumber: this.order.referralSequenceNumber,
|
referralSequenceNumber: this.order.referralSequenceNumber,
|
||||||
eon: this.order.eon
|
eon: this.order.eon,
|
||||||
|
submitToMainframe: !!this.order.referralNumber
|
||||||
},
|
},
|
||||||
additionalSuccessEventDataHandler: (response) =>
|
additionalSuccessEventDataHandler: (response) =>
|
||||||
`Email provided: ${customer.emailAddress ? 'true' : 'false'}`
|
`Email provided: ${customer.emailAddress ? 'true' : 'false'}`
|
||||||
|
|
|
||||||
|
|
@ -1699,7 +1699,14 @@ describe('Store', () => {
|
||||||
describe('successful method call', () => {
|
describe('successful method call', () => {
|
||||||
it('calls get final deductible api endpoint', () => {
|
it('calls get final deductible api endpoint', () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
globalMethods.callHttpClient = jest.fn().mockReturnValue(Promise.resolve({}));
|
const response = {
|
||||||
|
data: {
|
||||||
|
deductible: getRandomInt(0, 5000),
|
||||||
|
policyData: getRandomString(100, 200)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
globalMethods.callHttpClient = jest.fn().mockReturnValue(Promise.resolve(response));
|
||||||
store.order.damage.glassToReplace = [getRandomString(10, 15)];
|
store.order.damage.glassToReplace = [getRandomString(10, 15)];
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
|
|
@ -1713,7 +1720,13 @@ describe('Store', () => {
|
||||||
});
|
});
|
||||||
it('returns expected response object', async () => {
|
it('returns expected response object', async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const response = { deductible: getRandomInt(0, 5000) };
|
const response = {
|
||||||
|
data: {
|
||||||
|
deductible: getRandomInt(0, 5000),
|
||||||
|
policyData: getRandomString(100, 200)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
globalMethods.callHttpClient = jest.fn().mockReturnValue(Promise.resolve(response));
|
globalMethods.callHttpClient = jest.fn().mockReturnValue(Promise.resolve(response));
|
||||||
store.order.damage.glassToReplace = [getRandomString(10, 15)];
|
store.order.damage.glassToReplace = [getRandomString(10, 15)];
|
||||||
|
|
||||||
|
|
@ -1725,6 +1738,13 @@ describe('Store', () => {
|
||||||
});
|
});
|
||||||
it('calls api with expected payload', () => {
|
it('calls api with expected payload', () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
|
const response = {
|
||||||
|
data: {
|
||||||
|
deductible: getRandomInt(0, 5000),
|
||||||
|
policyData: getRandomString(100, 200)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const location = getRandomString(10, 15).toUpperCase();
|
const location = getRandomString(10, 15).toUpperCase();
|
||||||
store.order.damage.glassToReplace = [
|
store.order.damage.glassToReplace = [
|
||||||
{
|
{
|
||||||
|
|
@ -1740,6 +1760,15 @@ describe('Store', () => {
|
||||||
const currentDeductible = getRandomInt(0, 5000);
|
const currentDeductible = getRandomInt(0, 5000);
|
||||||
const noCoverage = getRandomBoolean();
|
const noCoverage = getRandomBoolean();
|
||||||
const isRepair = getRandomBoolean();
|
const isRepair = getRandomBoolean();
|
||||||
|
const policyNumber = getRandomString(10, 20);
|
||||||
|
const insuredFirstName = getRandomString(10, 20);
|
||||||
|
const insuredLastName = getRandomString(10, 20);
|
||||||
|
const insuredZipCode = getRandomInt(10000, 99999).toString();
|
||||||
|
const policyVehicleId = getRandomInt(1, 2).toString();
|
||||||
|
const vehicleVin = getRandomString(17, 17);
|
||||||
|
const policyData = getRandomString(100, 200);
|
||||||
|
const isItac = getRandomBoolean();
|
||||||
|
|
||||||
store.order.referralCorrelationId = referralCorrelationId;
|
store.order.referralCorrelationId = referralCorrelationId;
|
||||||
store.issConfig.parentAccountNumber = accountNumber;
|
store.issConfig.parentAccountNumber = accountNumber;
|
||||||
store.order.currentDeductible = currentDeductible;
|
store.order.currentDeductible = currentDeductible;
|
||||||
|
|
@ -1747,7 +1776,17 @@ describe('Store', () => {
|
||||||
store.order.policy.status = status;
|
store.order.policy.status = status;
|
||||||
store.order.customer.address.state = policyState;
|
store.order.customer.address.state = policyState;
|
||||||
store.order.damage.isRepair = isRepair;
|
store.order.damage.isRepair = isRepair;
|
||||||
globalMethods.callHttpClient = jest.fn().mockReturnValue(Promise.resolve({}));
|
store.order.policy.policyNumber = policyNumber;
|
||||||
|
store.order.customer.firstName = insuredFirstName;
|
||||||
|
store.order.customer.lastName = insuredLastName;
|
||||||
|
store.order.customer.address.zipCode = insuredZipCode;
|
||||||
|
store.order.vehicle.policyVehicleId = policyVehicleId;
|
||||||
|
store.order.vehicle.vin = vehicleVin;
|
||||||
|
store.order.policy.policyData = policyData;
|
||||||
|
|
||||||
|
store.updatePolicyITACFlag(isItac);
|
||||||
|
|
||||||
|
globalMethods.callHttpClient = jest.fn().mockReturnValue(Promise.resolve(response));
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
store.getFinalDeductible();
|
store.getFinalDeductible();
|
||||||
|
|
@ -1765,12 +1804,27 @@ describe('Store', () => {
|
||||||
status,
|
status,
|
||||||
currentDeductible,
|
currentDeductible,
|
||||||
noCoverage,
|
noCoverage,
|
||||||
isRepair
|
isRepair,
|
||||||
|
policyNumber,
|
||||||
|
insuredFirstName,
|
||||||
|
insuredLastName,
|
||||||
|
insuredZipCode,
|
||||||
|
policyVehicleId,
|
||||||
|
vehicleVin,
|
||||||
|
policyData,
|
||||||
|
isItac
|
||||||
})
|
})
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
it('only "Yes" endorsement answers are added to payload', () => {
|
it('only "Yes" endorsement answers are added to payload', () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
|
const response = {
|
||||||
|
data: {
|
||||||
|
deductible: getRandomInt(0, 5000),
|
||||||
|
policyData: getRandomString(100, 200)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const location = getRandomString(10, 15).toUpperCase();
|
const location = getRandomString(10, 15).toUpperCase();
|
||||||
store.order.damage.glassToReplace = [
|
store.order.damage.glassToReplace = [
|
||||||
{
|
{
|
||||||
|
|
@ -1805,6 +1859,15 @@ describe('Store', () => {
|
||||||
selectedAnswer: 'No'
|
selectedAnswer: 'No'
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
const policyNumber = getRandomString(10, 20);
|
||||||
|
const insuredFirstName = getRandomString(10, 20);
|
||||||
|
const insuredLastName = getRandomString(10, 20);
|
||||||
|
const insuredZipCode = getRandomInt(10000, 99999).toString();
|
||||||
|
const policyVehicleId = getRandomInt(1, 2).toString();
|
||||||
|
const vehicleVin = getRandomString(17, 17);
|
||||||
|
const policyData = getRandomString(100, 200);
|
||||||
|
const isItac = false;
|
||||||
|
|
||||||
store.order.referralCorrelationId = referralCorrelationId;
|
store.order.referralCorrelationId = referralCorrelationId;
|
||||||
store.issConfig.parentAccountNumber = accountNumber;
|
store.issConfig.parentAccountNumber = accountNumber;
|
||||||
store.order.currentDeductible = currentDeductible;
|
store.order.currentDeductible = currentDeductible;
|
||||||
|
|
@ -1813,7 +1876,17 @@ describe('Store', () => {
|
||||||
store.order.customer.address.state = policyState;
|
store.order.customer.address.state = policyState;
|
||||||
store.order.policy.endorsementQuestionAnswers = endorsementAnswers;
|
store.order.policy.endorsementQuestionAnswers = endorsementAnswers;
|
||||||
store.order.damage.isRepair = isRepair;
|
store.order.damage.isRepair = isRepair;
|
||||||
globalMethods.callHttpClient = jest.fn().mockReturnValue(Promise.resolve({}));
|
store.order.policy.policyNumber = policyNumber;
|
||||||
|
store.order.customer.firstName = insuredFirstName;
|
||||||
|
store.order.customer.lastName = insuredLastName;
|
||||||
|
store.order.customer.address.zipCode = insuredZipCode;
|
||||||
|
store.order.vehicle.policyVehicleId = policyVehicleId;
|
||||||
|
store.order.vehicle.vin = vehicleVin;
|
||||||
|
store.order.policy.policyData = policyData;
|
||||||
|
|
||||||
|
store.updatePolicyITACFlag(isItac);
|
||||||
|
|
||||||
|
globalMethods.callHttpClient = jest.fn().mockReturnValue(Promise.resolve(response));
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
store.getFinalDeductible();
|
store.getFinalDeductible();
|
||||||
|
|
@ -1832,7 +1905,15 @@ describe('Store', () => {
|
||||||
status,
|
status,
|
||||||
currentDeductible,
|
currentDeductible,
|
||||||
noCoverage,
|
noCoverage,
|
||||||
isRepair
|
isRepair,
|
||||||
|
policyNumber,
|
||||||
|
insuredFirstName,
|
||||||
|
insuredLastName,
|
||||||
|
insuredZipCode,
|
||||||
|
policyVehicleId,
|
||||||
|
vehicleVin,
|
||||||
|
policyData,
|
||||||
|
isItac
|
||||||
})
|
})
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue