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