SSR-1134 Only show fees for NoComp and ITAC
This commit is contained in:
parent
7c5dd4fbf0
commit
d1ce437b91
5 changed files with 37 additions and 48 deletions
|
|
@ -42,13 +42,7 @@ function getMountedComponent(mainInitialState = {}, initialData = {}, propsData
|
|||
describe('cart-dropdown component', () => {
|
||||
test('initial data rendered as expected', () => {
|
||||
// Arrange
|
||||
const { wrapper } = getMountedComponent({
|
||||
order: {
|
||||
lineItems: {
|
||||
supportingItems: []
|
||||
}
|
||||
}
|
||||
});
|
||||
const { wrapper } = getMountedComponent({});
|
||||
|
||||
// Assert
|
||||
expect(wrapper.vm.$data).toMatchSnapshot();
|
||||
|
|
@ -239,13 +233,9 @@ describe('cart-dropdown component', () => {
|
|||
// Arrange
|
||||
const storeData = {
|
||||
order: {
|
||||
payment: {
|
||||
insuranceCoverage: {
|
||||
coverageStatus: coverageStatuses.NO_COMP
|
||||
}
|
||||
},
|
||||
policy: {
|
||||
isITAC: isItac
|
||||
isITAC: isItac,
|
||||
noCoverage: true,
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -285,13 +275,9 @@ describe('cart-dropdown component', () => {
|
|||
// Arrange
|
||||
const storeData = {
|
||||
order: {
|
||||
payment: {
|
||||
insuranceCoverage: {
|
||||
coverageStatus: coverageStatuses.PENDING
|
||||
}
|
||||
},
|
||||
policy: {
|
||||
isITAC: false
|
||||
isITAC: false,
|
||||
noCoverage: false
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -309,13 +295,9 @@ describe('cart-dropdown component', () => {
|
|||
// Arrange
|
||||
const storeData = {
|
||||
order: {
|
||||
payment: {
|
||||
insuranceCoverage: {
|
||||
coverageStatus: coverageStatuses.NO_COMP
|
||||
}
|
||||
},
|
||||
policy: {
|
||||
isITAC: false
|
||||
isITAC: false,
|
||||
noCoverage: true,
|
||||
},
|
||||
currentDeductible: null
|
||||
}
|
||||
|
|
@ -378,13 +360,9 @@ describe('cart-dropdown component', () => {
|
|||
// Arrange
|
||||
const storeData = {
|
||||
order: {
|
||||
payment: {
|
||||
insuranceCoverage: {
|
||||
coverageStatus: coverageStatuses.VERIFIED
|
||||
}
|
||||
},
|
||||
policy: {
|
||||
isITAC: false
|
||||
isITAC: false,
|
||||
noCoverage: false
|
||||
},
|
||||
currentDeductible: null
|
||||
}
|
||||
|
|
@ -526,13 +504,9 @@ describe('cart-dropdown component', () => {
|
|||
// Arrange
|
||||
const storeData = {
|
||||
order: {
|
||||
payment: {
|
||||
insuranceCoverage: {
|
||||
coverageStatus: coverageStatuses.NO_COMP
|
||||
}
|
||||
},
|
||||
policy: {
|
||||
isITAC: false
|
||||
isITAC: false,
|
||||
noCoverage: true
|
||||
},
|
||||
currentDeductible: 321
|
||||
}
|
||||
|
|
@ -579,7 +553,7 @@ describe('cart-dropdown component', () => {
|
|||
test('Shows recycle fee when preset in supported items', () => {
|
||||
// Arrange
|
||||
const reference = '#recycle-fee-item';
|
||||
const {wrapper} = getMountedComponent({
|
||||
const { wrapper } = getMountedComponent({
|
||||
order: {
|
||||
lineItems: {
|
||||
supportingItems: [{
|
||||
|
|
@ -599,7 +573,7 @@ describe('cart-dropdown component', () => {
|
|||
test('Hides recycle fee when not in supported items', () => {
|
||||
// Arrange
|
||||
const reference = '#recycle-fee-item';
|
||||
const {wrapper} = getMountedComponent({
|
||||
const { wrapper } = getMountedComponent({
|
||||
order: {
|
||||
lineItems: {
|
||||
supportingItems: []
|
||||
|
|
|
|||
|
|
@ -45,9 +45,9 @@
|
|||
<div class="non-packaged-cart-item">
|
||||
<div
|
||||
id="mobile-fee"
|
||||
class="cart-item">
|
||||
class="cart-item"
|
||||
v-if="mobileFeeCartItem">
|
||||
<div
|
||||
v-if="mobileFeeCartItem"
|
||||
id="mobile-fee-item"
|
||||
class="d-flex justify-content-between align-items-center">
|
||||
<span id="mobile-fee-label">{{ mobileFeeCartItem.name }}</span>
|
||||
|
|
@ -57,9 +57,9 @@
|
|||
|
||||
<div
|
||||
id="recycle-fee"
|
||||
class="cart-item cart-gray">
|
||||
class="cart-item cart-gray"
|
||||
v-if="recycleFeeCartItem">
|
||||
<div
|
||||
v-if="recycleFeeCartItem"
|
||||
id="recycle-fee-item"
|
||||
class="d-flex justify-content-between align-items-center">
|
||||
<span id="recycle-fee-label">
|
||||
|
|
@ -199,7 +199,7 @@ export default {
|
|||
recycleFeeCartItem() {
|
||||
return this.getCartItem(
|
||||
this.getCmsContent(this.widget.recycleFee, widgetFields.TEXT_BLOCK_WIDGET.TEXT),
|
||||
this.mainStore.order.lineItems.supportingItems.find((lineItem) => lineItem.partType === partTypeStrings.REPLACE_FEE)
|
||||
this.mainStore.order.lineItems.supportingItems?.find((lineItem) => lineItem.partType === partTypeStrings.REPLACE_FEE)
|
||||
);
|
||||
},
|
||||
mobileFeeCartItem() {
|
||||
|
|
|
|||
|
|
@ -343,7 +343,10 @@ export default {
|
|||
let provider = this.selectedProvider;
|
||||
this.mainStore.updateMobileFee(null);
|
||||
if (this.isMobileLocationDisplayed) {
|
||||
this.mainStore.updateMobileFee(this.mobileFeePart);
|
||||
if (this.mainStore.isNoComp || this.mainStore.isITAC) {
|
||||
this.mainStore.updateMobileFee(this.mobileFeePart);
|
||||
}
|
||||
|
||||
provider = {
|
||||
providerNumber: this.mobileProviderNumber,
|
||||
address: {
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ export default {
|
|||
});
|
||||
},
|
||||
getAmountDue(lineItems) {
|
||||
if (!useMainStore().isNoComp && !useMainStore().policy.isITAC) {
|
||||
if (!useMainStore().isNoComp && !useMainStore().isITAC) {
|
||||
return useMainStore().order.currentDeductible;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import {
|
|||
noCoverageForSelectedVehicle,
|
||||
repairWaivedForSelectedVehicle
|
||||
} from '@/helpers/policy-vehicle-helper';
|
||||
import partTypeStrings from '@/constants/part-type-strings';
|
||||
|
||||
const storeId = 'main';
|
||||
|
||||
|
|
@ -260,7 +261,8 @@ export const useMainStore = defineStore({
|
|||
isClaimRegistrationRequired: (state) => state.issConfig.isClaimRegistrationRequired,
|
||||
isClaimAlreadyRegistered: (state) => state.order.payment.insuranceCoverage.claimNumber !== null,
|
||||
isBailout: (state) => state.applicationUser.pageData[issPageValues.BAILOUT_PAGE] != null,
|
||||
isNoComp: (state) => state.order.payment.insuranceCoverage.coverageStatus === coverageStatuses.NO_COMP,
|
||||
isNoComp: (state) => !!state.order.policy.noCoverage,
|
||||
isITAC: (state) => !!state.order.policy.isITAC,
|
||||
isVerifiedCoverageStatus: (state) => state.order.payment.insuranceCoverage.coverageStatus === coverageStatuses.VERIFIED,
|
||||
eventBusItem: (state) => (eventCategory, eventSubCategory) => {
|
||||
const matchedEvent = state.applicationUser.eventBus.find(({ category, subCategory }) => category === eventCategory && subCategory === eventSubCategory);
|
||||
|
|
@ -1533,7 +1535,17 @@ export const useMainStore = defineStore({
|
|||
},
|
||||
|
||||
updateSupportingItems(partsData) {
|
||||
this.order.lineItems.supportingItems = partsData;
|
||||
if (partsData == null) {
|
||||
this.order.lineItems.supportingItems = partsData;
|
||||
return;
|
||||
}
|
||||
|
||||
let parts = partsData;
|
||||
if (!this.isNoComp && !this.isITAC) {
|
||||
parts = parts.filter((i) => i.partNumber !== partTypeStrings.RECYCLE_FEE);
|
||||
}
|
||||
|
||||
this.order.lineItems.supportingItems = parts;
|
||||
},
|
||||
|
||||
updateVaps(partsData) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue