diff --git a/src/layouts/payment/payment-switch/payment-switch-button/payment-switch-button.spec.js b/src/layouts/payment/payment-switch/payment-switch-button/payment-switch-button.spec.js index eb97a414d..d6b52c436 100644 --- a/src/layouts/payment/payment-switch/payment-switch-button/payment-switch-button.spec.js +++ b/src/layouts/payment/payment-switch/payment-switch-button/payment-switch-button.spec.js @@ -110,10 +110,10 @@ function setupMocks(customMountOptions = {}) { customMountOptions.route = { query: { fmgPage: "page-name", - } + }, }; const mountOptions = getMountOptions(customMountOptions); - + const mockMixin = { methods: { getCmsContent: jest.fn((widgetName, cmsFieldName) => { @@ -130,4 +130,4 @@ function setupMocks(customMountOptions = {}) { wrapper.vm.setCmsContent = jest.fn(); return wrapper; -} \ No newline at end of file +} diff --git a/src/layouts/payment/payment-switch/payment-switch.spec.js b/src/layouts/payment/payment-switch/payment-switch.spec.js index 210a1660c..49b195127 100644 --- a/src/layouts/payment/payment-switch/payment-switch.spec.js +++ b/src/layouts/payment/payment-switch/payment-switch.spec.js @@ -38,7 +38,7 @@ describe("payment-switch", () => { ImageId: "Credit Card Id", AnswerImageUrl: "Credit Card Image", SubWidgetName: "Credit Card SubWidget", - } + }, ], }, }; @@ -125,4 +125,4 @@ function setupMocks(customMountOptions) { // act on vm return wrapper; -} \ No newline at end of file +} diff --git a/src/layouts/payment/payment.spec.js b/src/layouts/payment/payment.spec.js index 51a3d31f0..35da047f3 100644 --- a/src/layouts/payment/payment.spec.js +++ b/src/layouts/payment/payment.spec.js @@ -7,7 +7,7 @@ import { getMountOptions } from "@/helpers/unit-test-helper"; import store from "@/store"; import baseMixin from "@/mixins/base-mixin"; import { storeActions } from "@/constants/store-actions"; -import { paymentMethods } from "@/constants/payment-method-constants"; +import { paymentMethods } from "@/constants/payment-method-constants"; // Constants const parts = { @@ -63,7 +63,7 @@ const pricedParts = { kitPrice: 0, laborAmount: 20, salesTax: 0, - sellingPrice: 32.64 + sellingPrice: 32.64, }, rearWipers: { ...parts.rearWipers, @@ -94,12 +94,12 @@ const taxedParts = { }, rearWipers: { ...pricedParts.rearWipers, - salesTax: 6.00, + salesTax: 6.0, subTotal: 100, }, rainDefense: { ...pricedParts.rainDefense, - salesTax: 1.00, + salesTax: 1.0, subTotal: 100, }, }; @@ -111,7 +111,7 @@ let mockStoreActionData = {}; async function mockDispatchStoreAction(actionName) { return mockStoreActionData[actionName]; -}; +} jest.mock("@/mixins/base-mixin.js", () => ({ methods: { @@ -175,7 +175,7 @@ describe("payment.vue", () => { damage: { isRepair: false, numberOfChips: null, - glassToReplace: [{location: "windshield"}], + glassToReplace: [{ location: "windshield" }], }, lineItems: { glassParts: [parts.windshield], @@ -220,8 +220,14 @@ describe("payment.vue", () => { }, [storeActions.GET_WIPERS]: [parts.frontWipers, parts.rearWipers], [storeActions.GET_RAIN_DEFENSE]: parts.rainDefense, - [storeActions.PRICE_ORDER_ITEMS_AND_SAVE_SERVER_DATA]: [pricedParts.windshield, pricedParts.frontWipers], - [storeActions.TAX_ORDER_ITEMS_AND_SAVE_SERVER_DATA]: [taxedParts.windshield, taxedParts.frontWipers], + [storeActions.PRICE_ORDER_ITEMS_AND_SAVE_SERVER_DATA]: [ + pricedParts.windshield, + pricedParts.frontWipers, + ], + [storeActions.TAX_ORDER_ITEMS_AND_SAVE_SERVER_DATA]: [ + taxedParts.windshield, + taxedParts.frontWipers, + ], }; }); @@ -386,7 +392,7 @@ describe("payment.vue", () => { describe("getPiaLineItems", () => { test("Properly formatted output", () => { - // Arrange + // Arrange const wrapper = setupMocks({}); const cartItems = [ taxedParts.windshield, @@ -407,10 +413,7 @@ describe("payment.vue", () => { store.getters.order.lineItems.glassParts = null; const wrapper = setupMocks({}); - const cartItems = [ - taxedParts.frontWipers, - taxedParts.rainDefense, - ]; + const cartItems = [taxedParts.frontWipers, taxedParts.rainDefense]; // Act wrapper.vm.getPiaLineItems(cartItems); @@ -422,12 +425,14 @@ describe("payment.vue", () => { test("Does not include promos", () => { // Arrange - store.getters.order.lineItems.promos = [{ - name: "PROMO", - salesTax: 10, - subTotal: 20, - }]; - + store.getters.order.lineItems.promos = [ + { + name: "PROMO", + salesTax: 10, + subTotal: 20, + }, + ]; + const wrapper = setupMocks({}); const cartItems = [ taxedParts.windshield, @@ -520,7 +525,7 @@ describe("payment.vue", () => { // Act wrapper.vm.handleIFrameContentWindwMessage(event); - + // Assert expect(wrapper.vm.backButtonAction).toBeCalled(); }); @@ -535,7 +540,7 @@ describe("payment.vue", () => { // Act wrapper.vm.handleIFrameContentWindwMessage(event); - + // Assert expect(wrapper.vm.shouldBlockInteraction).toBe(true); }); @@ -551,7 +556,7 @@ describe("payment.vue", () => { wrapper.vm.setUIBlock(true); await wrapper.vm.$nextTick(); - + const uiBlockElements = wrapper.findAll(".ui-block"); // Assert