diff --git a/src/fmg-components/cart/cart.spec.js b/src/fmg-components/cart/cart.spec.js index 3e1e9760f..40255f322 100644 --- a/src/fmg-components/cart/cart.spec.js +++ b/src/fmg-components/cart/cart.spec.js @@ -263,6 +263,49 @@ describe("cart.vue", () => { expect(found).toBe(true); }); + // Mobile Fee Cart Item + test("if there is mobile fee on the order, a mobile fee cart item should be added to the cart", () => { + // Arrange + const lineItems = { + glassParts: [], + supportingItems: [ + { + description: null, + id: "9ff98501-03a4-432b-884e-e4e28f884a2f", + kitPrice: 0, + laborAmount: 34.98, + partNumber: "MOBILE FEE", + partType: "MOBILE FEE", + salesTax: 2.62, + sellingPrice: 0, + }, + ], + vaps: [], + promos: [], + }; + + const availableVaps = []; + + // Act + const { wrapper } = setupMocks({ + props: { + modelValue: lineItems, + availableVaps: availableVaps, + }, + }); + + // Assert + expect(wrapper.vm.mobileFeeCartItem).not.toBeNull(); + expect(wrapper.vm.mobileFeeCartItem.subTotal).toEqual(34.98); + expect(wrapper.vm.mobileFeeCartItem.salesTax).toEqual(2.62); + + const found = + wrapper.vm.cartItems.findIndex( + (cartItem) => cartItem == wrapper.vm.mobileFeeCartItem + ) >= 0; + expect(found).toBe(true); + }); + // Service package discount Fee Cart Item test("if there is service package discount fee on the order, a service package discount cart item should be added to the cart", () => { // Arrange