just taking the old before i start the PR over
This commit is contained in:
parent
0eb311a76b
commit
286f8662f6
1 changed files with 97 additions and 122 deletions
|
|
@ -83,30 +83,7 @@ function getMountedComponent(mainInitialState = {}, initialData = {}, methodToRu
|
|||
return { wrapper };
|
||||
}
|
||||
|
||||
describe('coverageStatement.vue', () => {
|
||||
describe('Navigation', () => {
|
||||
test('Function called on any FORWARD navigation', () => {
|
||||
// Arrange
|
||||
const mainInitialState = {
|
||||
order: {
|
||||
policy: {
|
||||
isITAC: null
|
||||
}
|
||||
}
|
||||
};
|
||||
const { wrapper } = getMountedComponent(mainInitialState);
|
||||
|
||||
// Act
|
||||
wrapper.vm.forwardButtonAction();
|
||||
|
||||
// Assert
|
||||
expect(wrapper.vm.mainStore.updatePolicyITACFlag)
|
||||
.toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe.skip('coverageStatement.vue-broken', () => {
|
||||
describe.skip('coverageStatement.vue', () => {
|
||||
describe('method arePagePrerequisitesValid...', () => {
|
||||
test('Should return true for valid page requisites if vin exists', () => {
|
||||
// Arrange
|
||||
|
|
@ -194,64 +171,6 @@ describe.skip('coverageStatement.vue-broken', () => {
|
|||
expect(footer.exists()).toBe(true);
|
||||
});
|
||||
});
|
||||
describe('ADAS', () => {
|
||||
test('if Replace and parts require recalibration, isADAS should return true', () => {
|
||||
// Arrange
|
||||
const mainInitialState = {
|
||||
order: {
|
||||
damage: {
|
||||
isRepair: false
|
||||
},
|
||||
lineItems: {
|
||||
glassParts: [
|
||||
{
|
||||
requiresRecalibration: true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
const { wrapper } = getMountedComponent(mainInitialState);
|
||||
|
||||
// Assert
|
||||
expect(wrapper.vm.isADAS).toBeTruthy();
|
||||
});
|
||||
test('if Replace and parts do not require recalibration, isADAS should return false', () => {
|
||||
// Arrange
|
||||
const mainInitialState = {
|
||||
order: {
|
||||
damage: {
|
||||
isRepair: false
|
||||
},
|
||||
lineItems: {
|
||||
glassParts: [
|
||||
{
|
||||
requiresRecalibration: false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
const { wrapper } = getMountedComponent(mainInitialState);
|
||||
|
||||
// Assert
|
||||
expect(wrapper.vm.isADAS).toBeFalsy();
|
||||
});
|
||||
test('if Repair, isADAS should return true', () => {
|
||||
// Arrange
|
||||
const mainInitialState = {
|
||||
order: {
|
||||
damage: {
|
||||
isRepair: true
|
||||
}
|
||||
}
|
||||
};
|
||||
const { wrapper } = getMountedComponent(mainInitialState);
|
||||
|
||||
// Assert
|
||||
expect(wrapper.vm.isADAS).toBeFalsy();
|
||||
});
|
||||
});
|
||||
describe('Verified ITAC scenario', () => {
|
||||
test('If policy lookup successful, not No Comp, and deductible > service price, verifiedITAC returns true', () => {
|
||||
// Arrange
|
||||
|
|
@ -452,6 +371,43 @@ describe.skip('coverageStatement.vue-broken', () => {
|
|||
expect(wrapper.vm.verifiedDeductible).toBeFalsy();
|
||||
});
|
||||
});
|
||||
describe('No Comp scenario', () => {
|
||||
test('If noCoverage = true, verifiedNoComp returns true', () => {
|
||||
// Arrange
|
||||
const mainInitialState = {
|
||||
order: {
|
||||
damage: {
|
||||
isRepair: true
|
||||
},
|
||||
policy: {
|
||||
noCoverage: true,
|
||||
policyLookupSuccessful: true
|
||||
}
|
||||
}
|
||||
};
|
||||
const { wrapper } = getMountedComponent(mainInitialState);
|
||||
|
||||
// Assert
|
||||
expect(wrapper.vm.verifiedNoComp).toBeTruthy();
|
||||
});
|
||||
test('If noCoverage = false, verifiedNoComp returns false', () => {
|
||||
// Arrange
|
||||
const mainInitialState = {
|
||||
order: {
|
||||
damage: {
|
||||
isRepair: true
|
||||
},
|
||||
policy: {
|
||||
noCoverage: false
|
||||
}
|
||||
}
|
||||
};
|
||||
const { wrapper } = getMountedComponent(mainInitialState);
|
||||
|
||||
// Assert
|
||||
expect(wrapper.vm.verifiedNoComp).toBeFalsy();
|
||||
});
|
||||
});
|
||||
describe('Unverified scenario', () => {
|
||||
test('If policyLookupSuccessful false, unverified returns true', () => {
|
||||
// Arrange
|
||||
|
|
@ -488,44 +444,6 @@ describe.skip('coverageStatement.vue-broken', () => {
|
|||
expect(wrapper.vm.unverified).toBeFalsy();
|
||||
});
|
||||
});
|
||||
describe('No Comp scenario', () => {
|
||||
test('If noCoverage = true, verifiedNoComp returns true', () => {
|
||||
// Arrange
|
||||
const mainInitialState = {
|
||||
order: {
|
||||
damage: {
|
||||
isRepair: true
|
||||
},
|
||||
policy: {
|
||||
noCoverage: true,
|
||||
policyLookupSuccessful: true
|
||||
}
|
||||
}
|
||||
};
|
||||
const { wrapper } = getMountedComponent(mainInitialState);
|
||||
const moqVerifiedNoComp = wrapper.vm.verifiedNoComp;
|
||||
|
||||
// Assert
|
||||
expect(moqVerifiedNoComp).toBe(true);
|
||||
});
|
||||
test('If noCoverage = false, verifiedNoComp returns false', () => {
|
||||
// Arrange
|
||||
const mainInitialState = {
|
||||
order: {
|
||||
damage: {
|
||||
isRepair: true
|
||||
},
|
||||
policy: {
|
||||
noCoverage: false
|
||||
}
|
||||
}
|
||||
};
|
||||
const { wrapper } = getMountedComponent(mainInitialState);
|
||||
|
||||
// Assert
|
||||
expect(wrapper.vm.verifiedNoComp).toBeFalsy();
|
||||
});
|
||||
});
|
||||
describe('Navigation', () => {
|
||||
test('If Unverified, navigate forward with CLICKED_FORWARD scenario', () => {
|
||||
// Arrange
|
||||
|
|
@ -758,6 +676,64 @@ describe.skip('coverageStatement.vue-broken', () => {
|
|||
);
|
||||
});
|
||||
});
|
||||
describe('ADAS', () => {
|
||||
test('if Replace and parts require recalibration, isADAS should return true', () => {
|
||||
// Arrange
|
||||
const mainInitialState = {
|
||||
order: {
|
||||
damage: {
|
||||
isRepair: false
|
||||
},
|
||||
lineItems: {
|
||||
glassParts: [
|
||||
{
|
||||
requiresRecalibration: true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
const { wrapper } = getMountedComponent(mainInitialState);
|
||||
|
||||
// Assert
|
||||
expect(wrapper.vm.isADAS).toBeTruthy();
|
||||
});
|
||||
test('if Replace and parts do not require recalibration, isADAS should return false', () => {
|
||||
// Arrange
|
||||
const mainInitialState = {
|
||||
order: {
|
||||
damage: {
|
||||
isRepair: false
|
||||
},
|
||||
lineItems: {
|
||||
glassParts: [
|
||||
{
|
||||
requiresRecalibration: false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
const { wrapper } = getMountedComponent(mainInitialState);
|
||||
|
||||
// Assert
|
||||
expect(wrapper.vm.isADAS).toBeFalsy();
|
||||
});
|
||||
test('if Repair, isADAS should return true', () => {
|
||||
// Arrange
|
||||
const mainInitialState = {
|
||||
order: {
|
||||
damage: {
|
||||
isRepair: true
|
||||
}
|
||||
}
|
||||
};
|
||||
const { wrapper } = getMountedComponent(mainInitialState);
|
||||
|
||||
// Assert
|
||||
expect(wrapper.vm.isADAS).toBeFalsy();
|
||||
});
|
||||
});
|
||||
describe('claim registration api call', () => {
|
||||
it('claim registration not required => method not called', async () => {
|
||||
// Arrange
|
||||
|
|
@ -770,8 +746,7 @@ describe.skip('coverageStatement.vue-broken', () => {
|
|||
// Assert
|
||||
expect(wrapper.vm.mainStore.registerClaim).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
describe('claim registration api call', () => {
|
||||
|
||||
it.only('claim registration required => register claim method called', async () => {
|
||||
// Arrange
|
||||
const sellingPrice = getRandomInt(50, 100);
|
||||
|
|
|
|||
Loading…
Reference in a new issue