diff --git a/src/iss-components/cart-dropdown/cart-dropdown.spec.js b/src/iss-components/cart-dropdown/cart-dropdown.spec.js index 3c3c5774..842cbcd5 100644 --- a/src/iss-components/cart-dropdown/cart-dropdown.spec.js +++ b/src/iss-components/cart-dropdown/cart-dropdown.spec.js @@ -141,6 +141,8 @@ describe('cart-dropdown component', () => { // Assert expect(servicePackage.exists()).toBeTruthy(); }); + test.todo('non service package cart items', () => { }); + test.todo('recycle cart item label when isRecycle true for some cart item', () => { }); test('cart footer', () => { // Arrange const reference = '#cart-footer'; @@ -180,6 +182,7 @@ describe('cart-dropdown component', () => { // Assert expect(salesTax.exists()).toBeTruthy(); }); + // TODO remove test('recycle fee when preset in supported items', () => { // Arrange const reference = '#recycle-fee-item'; @@ -200,6 +203,7 @@ describe('cart-dropdown component', () => { expect(wrapper.vm.recycleFeeCartItem).not.toBeNull(); expect(recycleFee.exists()).toBeTruthy(); }); + // TODO remove test('mobile fee when preset', () => { // Arrange const reference = '#mobile-fee-item'; @@ -284,6 +288,8 @@ describe('cart-dropdown component', () => { // Assert expect(cartBasePrice.exists()).toBeFalsy(); }); + test.todo('recycle cart item label when isRecycle false for all cart items', () => { }); + // TODO remove test('recycle fee when not in supported items', () => { // Arrange const reference = '#recycle-fee-item'; @@ -302,6 +308,7 @@ describe('cart-dropdown component', () => { expect(wrapper.vm.recycleFeeCartItem).toBeNull(); expect(recycleFee.exists()).toBeFalsy(); }); + // TODO remove test('mobile fee when not in supported items', () => { // Arrange const reference = '#mobile-fee-item'; @@ -323,6 +330,7 @@ describe('cart-dropdown component', () => { }); }); describe('computed', () => { + // TODO remove describe('showDeductibleLineItem', () => { test.each([[true], [false]])('returns false when isNoComp true', (isItac) => { // Arrange @@ -512,12 +520,9 @@ describe('cart-dropdown component', () => { // TODO when subTotal and salesTax are finished }); }); - describe('subTotal', () => { - // TODO when method implemented - }); - describe('salesTax', () => { - // TODO when method implemented + describe.todo('subTotal', () => { }); + describe.todo('salesTax', () => {}); describe('availableLineItems', () => { test('returns expected when glassParts null', async () => { // Arrange @@ -831,6 +836,7 @@ describe('cart-dropdown component', () => { })); }); }); + describe.todo('nonServicePackageCartItems', () => {}); describe('servicePackageLabelWidget', () => { test.each([ [null], diff --git a/src/iss-components/cart-dropdown/cart-dropdown.vue b/src/iss-components/cart-dropdown/cart-dropdown.vue index 7aae7349..be82c3d6 100644 --- a/src/iss-components/cart-dropdown/cart-dropdown.vue +++ b/src/iss-components/cart-dropdown/cart-dropdown.vue @@ -23,7 +23,7 @@ id="cart-deductible-or-base-price" class="cart-item cart-gray">
{{ deductibleLabel }} @@ -177,6 +177,8 @@ export default { const { supportingItems, glassParts, otherParts, vaps } = useMainStore().lineItems; return { + isNoComp: useMainStore().isNoComp, + isITAC: useMainStore().policy.isITAC, isRepair, glassToReplace: glassToReplace ?? [], vapsInOrder: vaps ?? [], @@ -205,11 +207,11 @@ export default { return getPriceOfLineItems(this.baseServiceLineItems); }, isUnverified() { - return !useMainStore().isNoComp && !useMainStore().policy.isITAC + return !this.isNoComp && !this.isITAC && (this.deductible == null || !useMainStore().isVerifiedCoverageStatus); }, subTotal() { - const basePrice = !useMainStore().isNoComp && !useMainStore().policy.isITAC + const basePrice = !this.isNoComp && !this.isITAC ? this.deductible : this.baseServicePrice; const nonPackageCartItemsPrice = this.nonServicePackageCartItems.reduce( @@ -370,8 +372,8 @@ export default { getDisplayed(amount, canBeVerifyingCoverage = true) { return canBeVerifyingCoverage && this.isUnverified - && !useMainStore().isNoComp - && !useMainStore().policy.isITAC + && !this.isNoComp + && !this.isITAC ? VERIFYING_COVERAGE : formatAmountInDollars(amount); },