remove FL logic, update tests
This commit is contained in:
parent
faee351ca1
commit
7fb77db81a
2 changed files with 8 additions and 53 deletions
|
|
@ -531,9 +531,6 @@ export const useMainStore = defineStore({
|
|||
glassInformation?.forEach((glassPiece) => {
|
||||
manualGlassNamesArray.push(glassPiece?.glassLocation?.toUpperCase());
|
||||
});
|
||||
if (this.order.customer.address.state === 'FL' && this.order.damage.isRepair) {
|
||||
manualGlassNamesArray.push(damageLocationsSelected.WINDSHIELD.toUpperCase());
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
globalMethods.callHttpClient({
|
||||
|
|
@ -547,7 +544,8 @@ export const useMainStore = defineStore({
|
|||
policyState: this.order.customer.address.state,
|
||||
status: this.order.policy.status,
|
||||
currentDeductible: this.order.currentDeductible,
|
||||
noCoverage: this.order.policy.noCoverage
|
||||
noCoverage: this.order.policy.noCoverage,
|
||||
isRepair: this.order.damage.isRepair
|
||||
}
|
||||
}).then((r) => {
|
||||
this.updateDeductible(r.data);
|
||||
|
|
|
|||
|
|
@ -1739,6 +1739,7 @@ describe('Store', () => {
|
|||
const status = getRandomString(6, 8);
|
||||
const currentDeductible = getRandomInt(0, 5000);
|
||||
const noCoverage = getRandomBoolean();
|
||||
const isRepair = getRandomBoolean();
|
||||
store.order.referralCorrelationId = referralCorrelationId;
|
||||
store.issConfig.parentAccountNumber = accountNumber;
|
||||
store.order.currentDeductible = currentDeductible;
|
||||
|
|
@ -1762,7 +1763,8 @@ describe('Store', () => {
|
|||
policyState,
|
||||
status,
|
||||
currentDeductible,
|
||||
noCoverage
|
||||
noCoverage,
|
||||
isRepair
|
||||
})
|
||||
}));
|
||||
});
|
||||
|
|
@ -1781,6 +1783,7 @@ describe('Store', () => {
|
|||
const status = getRandomString(6, 8);
|
||||
const currentDeductible = getRandomInt(0, 5000);
|
||||
const noCoverage = getRandomBoolean();
|
||||
const isRepair = getRandomBoolean();
|
||||
const endorsementAnswers = [
|
||||
{
|
||||
questionNum: getRandomInt(1, 10),
|
||||
|
|
@ -1826,54 +1829,8 @@ describe('Store', () => {
|
|||
policyState,
|
||||
status,
|
||||
currentDeductible,
|
||||
noCoverage
|
||||
})
|
||||
}));
|
||||
});
|
||||
it('manualGlassNames updated if Florida windshield repair', () => {
|
||||
// Arrange
|
||||
const location = 'WINDSHIELD';
|
||||
store.order.damage.glassToReplace = [
|
||||
{
|
||||
glassLocation: location
|
||||
}
|
||||
];
|
||||
store.order.policy.endorsementQuestionAnswers = [];
|
||||
const referralCorrelationId = getRandomGuid();
|
||||
const referralNumber = getRandomString(6, 6);
|
||||
const accountNumber = getRandomString(6, 6);
|
||||
const endorsements = [];
|
||||
const expectedManualGlassName = ['WINDSHIELD'];
|
||||
const policyState = getRandomString(2, 2);
|
||||
const status = getRandomString(6, 8);
|
||||
const currentDeductible = getRandomInt(0, 5000);
|
||||
const noCoverage = getRandomBoolean();
|
||||
store.order.referralCorrelationId = referralCorrelationId;
|
||||
store.order.referralNumber = referralNumber;
|
||||
store.issConfig.parentAccountNumber = accountNumber;
|
||||
store.order.currentDeductible = currentDeductible;
|
||||
store.order.policy.noCoverage = noCoverage;
|
||||
store.order.policy.status = status;
|
||||
store.order.customer.address.state = policyState;
|
||||
store.order.damage.isRepair = true;
|
||||
globalMethods.callHttpClient = jest.fn().mockReturnValue(Promise.resolve({}));
|
||||
|
||||
// Act
|
||||
store.getFinalDeductible();
|
||||
|
||||
// Assert
|
||||
expect(globalMethods.callHttpClient).toHaveBeenCalledWith(({
|
||||
method: endpoints.FinalDeductible.method,
|
||||
endpoint: endpoints.FinalDeductible.url,
|
||||
payload: ({
|
||||
referralCorrelationId,
|
||||
accountNumber,
|
||||
endorsements,
|
||||
manualGlassNames: expectedManualGlassName,
|
||||
policyState,
|
||||
status,
|
||||
currentDeductible,
|
||||
noCoverage
|
||||
noCoverage,
|
||||
isRepair
|
||||
})
|
||||
}));
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue