From a3de3f7ca4b16e055bc82fc317a5dc8267cbf818 Mon Sep 17 00:00:00 2001 From: brydon1 Date: Fri, 28 Jul 2023 16:29:42 -0400 Subject: [PATCH] Fixing styling --- .../coverage-statement.spec.js | 493 ++++++++---------- 1 file changed, 220 insertions(+), 273 deletions(-) diff --git a/src/layouts/coverage-statement/coverage-statement.spec.js b/src/layouts/coverage-statement/coverage-statement.spec.js index 7628a873..d9b8f0aa 100644 --- a/src/layouts/coverage-statement/coverage-statement.spec.js +++ b/src/layouts/coverage-statement/coverage-statement.spec.js @@ -12,40 +12,95 @@ import { settleAllPromises } from '@/helpers/layout-helper.js'; import { fetchCmsContentForPage } from '@/helpers/cms-content-helper'; // Mock our module for promises -jest.mock("@/helpers/layout-helper.js", () => ({ +jest.mock('@/helpers/layout-helper.js', () => ({ settleAllPromises: jest.fn(), })); // Mock fetchCmsContentForPage, setupModalLinks, and processIfStatements -jest.mock("@/helpers/cms-content-helper", () => ({ +jest.mock('@/helpers/cms-content-helper', () => ({ fetchCmsContentForPage: jest.fn(), setupModalLinks: jest.fn(), processIfStatements: jest.fn() })); +const mockMixin = { + methods: { + getCmsContent: jest.fn().mockImplementation(() => ''), + setCmsContent: jest.fn() + } +}; + +const footerStub = { + render: () => {}, + methods: { + updateButtonText: jest.fn() + } +}; + +const loadingModalStub = { + render: () => {}, + methods: { + showModal: jest.fn(), + hideModal: jest.fn() + } +}; + +function setupMocks() { + const mountOptions = getMountOptions({ + router: { + navigate: jest.fn() + } + }); + + mountOptions.global = { + stubs: { + siteFooter: footerStub, + siteHeader: true, + recalModal: true, + contentGroupModal: true, + alert: true, + loadingModal: loadingModalStub + } + }; + + mountOptions.mixins = [mockMixin]; + + const apiResponses = { + supportingItems: [] + }; + const apiPromise = Promise.resolve(apiResponses); + settleAllPromises.mockImplementation(() => apiPromise); + fetchCmsContentForPage.mockImplementation(() => Promise.resolve()); + + const wrapper = mount(coverageStatement, mountOptions); + wrapper.vm.$refs.siteFooter.updateButtonText = jest.fn(); + wrapper.vm.$refs.loadingModal.showModal = jest.fn(); + return { wrapper }; +} + describe('coverageStatement.vue', () => { - describe("method arePagePrerequisitesValid...", () => { - test("Should return true for valid page requisites if vin exists", () => { + describe('method arePagePrerequisitesValid...', () => { + test('Should return true for valid page requisites if vin exists', () => { // Arrange const { wrapper } = setupMocks({}); useMainStore().order.vehicle.vin = getRandomString(5,20); // Act - let arePagePrerequisitesValid = wrapper.vm.arePagePrerequisitesValid(); + const arePagePrerequisitesValid = wrapper.vm.arePagePrerequisitesValid(); - //Assert + // Assert expect(arePagePrerequisitesValid).toBe(true); }); - test("Should return false for valid page requisites if vin is missing", () => { + test('Should return false for valid page requisites if vin is missing', () => { // Arrange const { wrapper } = setupMocks({}); - + useMainStore().order.vehicle.vin = null; // Act - let arePagePrerequisitesValid = wrapper.vm.arePagePrerequisitesValid(); + const arePagePrerequisitesValid = wrapper.vm.arePagePrerequisitesValid(); - //Assert + // Assert expect(arePagePrerequisitesValid).toBe(false); }); }); @@ -59,7 +114,7 @@ describe('coverageStatement.vue', () => { // Assert expect(siteHeader.exists()).toBe(true); - }), + }); test('Should render site subheader', () => { // Arrange const { wrapper } = setupMocks({}); @@ -70,6 +125,7 @@ describe('coverageStatement.vue', () => { // Assert expect(subheader.exists()).toBe(true); }); + test('Should render explanatory text', () => { // Arrange const { wrapper } = setupMocks({}); @@ -102,20 +158,12 @@ describe('coverageStatement.vue', () => { }); }); describe('Verified ITAC scenario', () => { - const loadingModal = { - render: () => {}, - methods: { - showModal: jest.fn(), - hideModal: jest.fn() - } - } - const sellingPrice = getRandomInt(100, 500); - test('If policy lookup successful, not No Comp, and deductible > service price, verifiedITAC returns true', () => { // Arrange const mountOptions = { mixins: [mockMixin] }; + const sellingPrice = getRandomInt(100, 500); const deductible = sellingPrice + 1; const mainInitialState = { order: { @@ -125,7 +173,7 @@ describe('coverageStatement.vue', () => { policy: { noCoverage: false, deductible: { - repair: deductible, + repair: deductible }, policyLookupSuccessful: true } @@ -138,26 +186,26 @@ describe('coverageStatement.vue', () => { } })], stubs: { - 'siteFooter': footer, + siteFooter: footerStub, siteHeader: true, recalModal: true, contentGroupModal: true, alert: true, - 'loadingModal': loadingModal - }, - } + loadingModal: loadingModalStub + } + }; // Act const wrapper = mount(coverageStatement, mountOptions); wrapper.setData({ availableLineItems: [ { - sellingPrice: sellingPrice, - kitPrice: 0, - laborAmount: 0, + sellingPrice, + kitPrice: 0, + laborAmount: 0 } ] - }) + }); // Assert expect(wrapper.vm.verifiedITAC).toBeTruthy(); @@ -167,7 +215,7 @@ describe('coverageStatement.vue', () => { const mountOptions = { mixins: [mockMixin] }; - + const mainInitialState = { order: { damage: { @@ -185,14 +233,14 @@ describe('coverageStatement.vue', () => { } })], stubs: { - 'siteFooter': footer, + siteFooter: footerStub, siteHeader: true, recalModal: true, contentGroupModal: true, alert: true, - 'loadingModal': loadingModal - }, - } + loadingModal: loadingModalStub + } + }; // Act const wrapper = mount(coverageStatement, mountOptions); @@ -211,7 +259,7 @@ describe('coverageStatement.vue', () => { isRepair: true }, policy: { - noCoverage: true, + noCoverage: true } } }; @@ -222,14 +270,14 @@ describe('coverageStatement.vue', () => { } })], stubs: { - 'siteFooter': footer, + siteFooter: footerStub, siteHeader: true, recalModal: true, contentGroupModal: true, alert: true, - 'loadingModal': loadingModal - }, - } + loadingModal: loadingModalStub + } + }; // Act const wrapper = mount(coverageStatement, mountOptions); @@ -242,6 +290,7 @@ describe('coverageStatement.vue', () => { const mountOptions = { mixins: [mockMixin] }; + const sellingPrice = getRandomInt(100, 500); const deductible = sellingPrice - 1; const mainInitialState = { order: { @@ -251,7 +300,7 @@ describe('coverageStatement.vue', () => { policy: { noCoverage: false, deductible: { - repair: deductible, + repair: deductible } } } @@ -263,40 +312,32 @@ describe('coverageStatement.vue', () => { } })], stubs: { - 'siteFooter': footer, + siteFooter: footerStub, siteHeader: true, recalModal: true, contentGroupModal: true, alert: true, - 'loadingModal': loadingModal - }, - } + loadingModal: loadingModalStub + } + }; // Act const wrapper = mount(coverageStatement, mountOptions); wrapper.setData({ availableLineItems: [ { - sellingPrice: sellingPrice, - kitPrice: 0, - laborAmount: 0, + sellingPrice, + kitPrice: 0, + laborAmount: 0 } ] - }) + }); // Assert expect(wrapper.vm.verifiedITAC).toBeFalsy(); }); }); describe('Verified Deductible scenario', () => { - const loadingModal = { - render: () => {}, - methods: { - showModal: jest.fn(), - hideModal: jest.fn() - } - } - test('If policy lookup successful, not No Comp, and service price > deductible, verifiedITAC returns true', () => { // Arrange const mountOptions = { @@ -312,7 +353,7 @@ describe('coverageStatement.vue', () => { policy: { noCoverage: false, deductible: { - repair: deductible, + repair: deductible }, policyLookupSuccessful: true } @@ -325,26 +366,26 @@ describe('coverageStatement.vue', () => { } })], stubs: { - 'siteFooter': footer, + siteFooter: footerStub, siteHeader: true, recalModal: true, contentGroupModal: true, alert: true, - 'loadingModal': loadingModal - }, - } + loadingModal: loadingModalStub + } + }; // Act const wrapper = mount(coverageStatement, mountOptions); wrapper.setData({ availableLineItems: [ { - sellingPrice: sellingPrice, - kitPrice: 0, - laborAmount: 0, + sellingPrice, + kitPrice: 0, + laborAmount: 0 } ] - }) + }); // Assert expect(wrapper.vm.verifiedDeductible).toBeTruthy(); @@ -371,14 +412,14 @@ describe('coverageStatement.vue', () => { } })], stubs: { - 'siteFooter': footer, + siteFooter: footerStub, siteHeader: true, recalModal: true, contentGroupModal: true, alert: true, - 'loadingModal': loadingModal - }, - } + loadingModal: loadingModalStub + } + }; // Act const wrapper = mount(coverageStatement, mountOptions); @@ -398,7 +439,7 @@ describe('coverageStatement.vue', () => { isRepair: true }, policy: { - noCoverage: true, + noCoverage: true } } }; @@ -409,18 +450,18 @@ describe('coverageStatement.vue', () => { } })], stubs: { - 'siteFooter': footer, + siteFooter: footerStub, siteHeader: true, recalModal: true, contentGroupModal: true, alert: true, - 'loadingModal': loadingModal - }, - } + loadingModal: loadingModalStub + } + }; // Act const wrapper = mount(coverageStatement, mountOptions); - + // Assert expect(wrapper.vm.verifiedDeductible).toBeFalsy(); }); @@ -439,7 +480,7 @@ describe('coverageStatement.vue', () => { policy: { noCoverage: false, deductible: { - repair: deductible, + repair: deductible } } } @@ -451,40 +492,32 @@ describe('coverageStatement.vue', () => { } })], stubs: { - 'siteFooter': footer, + siteFooter: footerStub, siteHeader: true, recalModal: true, contentGroupModal: true, alert: true, - 'loadingModal': loadingModal - }, - } + loadingModal: loadingModalStub + } + }; // Act const wrapper = mount(coverageStatement, mountOptions); wrapper.setData({ availableLineItems: [ { - sellingPrice: sellingPrice, - kitPrice: 0, - laborAmount: 0, + sellingPrice, + kitPrice: 0, + laborAmount: 0 } ] - }) + }); // Assert expect(wrapper.vm.verifiedDeductible).toBeFalsy(); }); }); describe('No Comp scenario', () => { - const loadingModal = { - render: () => {}, - methods: { - showModal: jest.fn(), - hideModal: jest.fn() - } - } - test('If noCoverage = true, verifiedNoComp returns true', () => { // Arrange const mountOptions = { @@ -508,18 +541,18 @@ describe('coverageStatement.vue', () => { } })], stubs: { - 'siteFooter': footer, + siteFooter: footerStub, siteHeader: true, recalModal: true, contentGroupModal: true, alert: true, - 'loadingModal': loadingModal - }, - } + loadingModal: loadingModalStub + } + }; // Act const wrapper = mount(coverageStatement, mountOptions); - + // Assert expect(wrapper.vm.verifiedNoComp).toBeTruthy(); }); @@ -534,7 +567,7 @@ describe('coverageStatement.vue', () => { isRepair: true }, policy: { - noCoverage: false, + noCoverage: false } } }; @@ -545,31 +578,23 @@ describe('coverageStatement.vue', () => { } })], stubs: { - 'siteFooter': footer, + siteFooter: footerStub, siteHeader: true, recalModal: true, contentGroupModal: true, alert: true, - 'loadingModal': loadingModal - }, - } + loadingModal: loadingModalStub + } + }; // Act const wrapper = mount(coverageStatement, mountOptions); - + // Assert expect(wrapper.vm.verifiedNoComp).toBeFalsy(); }); }); describe('Unverified scenario', () => { - const loadingModal = { - render: () => {}, - methods: { - showModal: jest.fn(), - hideModal: jest.fn() - } - } - test('If policyLookupSuccessful false, unverified returns true', () => { // Arrange const mountOptions = { @@ -592,18 +617,18 @@ describe('coverageStatement.vue', () => { } })], stubs: { - 'siteFooter': footer, + siteFooter: footerStub, siteHeader: true, recalModal: true, contentGroupModal: true, alert: true, - 'loadingModal': loadingModal - }, - } + loadingModal: loadingModalStub + } + }; // Act const wrapper = mount(coverageStatement, mountOptions); - + // Assert expect(wrapper.vm.unverified).toBeTruthy(); }); @@ -629,14 +654,14 @@ describe('coverageStatement.vue', () => { } })], stubs: { - 'siteFooter': footer, + siteFooter: footerStub, siteHeader: true, recalModal: true, contentGroupModal: true, alert: true, - 'loadingModal': loadingModal - }, - } + loadingModal: loadingModalStub + } + }; // Act const wrapper = mount(coverageStatement, mountOptions); @@ -646,21 +671,6 @@ describe('coverageStatement.vue', () => { }); }); describe('Navigation', () => { - const footer = { - render: () => {}, - methods: { - updateButtonText: jest.fn() - } - } - const loadingModal = { - render: () => {}, - methods: { - showModal: jest.fn(), - hideModal: jest.fn() - } - } - const sellingPrice = getRandomInt(100, 500); - test('If Unverified, navigate forward with CLICKED_FORWARD scenario', () => { // Arrange const mountOptions = { @@ -686,23 +696,23 @@ describe('coverageStatement.vue', () => { } })], stubs: { - 'siteFooter': footer, + siteFooter: footerStub, siteHeader: true, recalModal: true, contentGroupModal: true, alert: true, - 'loadingModal': loadingModal + loadingModal: loadingModalStub }, mocks: { $router: { navigate: jest.fn() } } - } + }; // Act const wrapper = mount(coverageStatement, mountOptions); - + // Act wrapper.vm.forwardButtonAction(); @@ -719,6 +729,7 @@ describe('coverageStatement.vue', () => { mixins: [mockMixin] }; + const sellingPrice = getRandomInt(100, 500); const deductible = sellingPrice - 1; const mainInitialState = { order: { @@ -728,7 +739,7 @@ describe('coverageStatement.vue', () => { policy: { noCoverage: false, deductible: { - repair: deductible, + repair: deductible }, policyLookupSuccessful: true } @@ -741,27 +752,27 @@ describe('coverageStatement.vue', () => { } })], stubs: { - 'siteFooter': footer, + siteFooter: footerStub, siteHeader: true, recalModal: true, contentGroupModal: true, alert: true, - 'loadingModal': loadingModal + loadingModal: loadingModalStub }, mocks: { $router: { navigate: jest.fn() } } - } + }; const wrapper = mount(coverageStatement, mountOptions); wrapper.setData({ availableLineItems: [ { - sellingPrice: sellingPrice, - kitPrice: 0, - laborAmount: 0, + sellingPrice, + kitPrice: 0, + laborAmount: 0 } ] }); @@ -781,6 +792,7 @@ describe('coverageStatement.vue', () => { }, mixins: [mockMixin] }; + const sellingPrice = getRandomInt(100, 500); const deductible = sellingPrice + 1; const mainInitialState = { order: { @@ -790,12 +802,11 @@ describe('coverageStatement.vue', () => { policy: { noCoverage: false, deductible: { - repair: deductible, + repair: deductible }, policyLookupSuccessful: true } - }, - + } }; mountOptions.global = { plugins: [createTestingPinia({ @@ -804,12 +815,12 @@ describe('coverageStatement.vue', () => { } })], stubs: { - 'siteFooter': footer, + siteFooter: footerStub, siteHeader: true, recalModal: true, contentGroupModal: true, alert: true, - 'loadingModal': loadingModal + loadingModal: loadingModalStub }, mocks: { $router: { @@ -822,22 +833,22 @@ describe('coverageStatement.vue', () => { wrapper.setData({ availableLineItems: [ { - sellingPrice: sellingPrice, - kitPrice: 0, - laborAmount: 0, + sellingPrice, + kitPrice: 0, + laborAmount: 0 } ], selectedProvider: 'Safelite' }); - + // Act wrapper.vm.forwardButtonAction(); // Assert expect(wrapper.vm.$router.navigate) - .toHaveBeenCalledWith(navigationScenarios.CLICKED_FORWARD_WITH_SAFELITE, undefined); + .toHaveBeenCalledWith(navigationScenarios.CLICKED_FORWARD_WITH_SAFELITE, undefined); }); - test('If Verified ITAC, selected other shop, and TPA enabled, navigate forward with CLICKED_FORWARD_WITH_TPA_ENABLED scenario', () => { + test('If Verified ITAC, selected other shop, and TPA enabled, navigate forward w/ CLICKED_FORWARD_WITH_TPA_ENABLED', () => { // Arrange const mountOptions = { router: { @@ -845,7 +856,7 @@ describe('coverageStatement.vue', () => { }, mixins: [mockMixin] }; - + const sellingPrice = getRandomInt(100, 500); const deductible = sellingPrice + 1; const mainInitialState = { order: { @@ -855,7 +866,7 @@ describe('coverageStatement.vue', () => { policy: { noCoverage: false, deductible: { - repair: deductible, + repair: deductible }, policyLookupSuccessful: true } @@ -871,12 +882,12 @@ describe('coverageStatement.vue', () => { } })], stubs: { - 'siteFooter': footer, + siteFooter: footerStub, siteHeader: true, recalModal: true, contentGroupModal: true, alert: true, - 'loadingModal': loadingModal + loadingModal: loadingModalStub }, mocks: { $router: { @@ -889,14 +900,14 @@ describe('coverageStatement.vue', () => { wrapper.setData({ availableLineItems: [ { - sellingPrice: sellingPrice, - kitPrice: 0, - laborAmount: 0, + sellingPrice, + kitPrice: 0, + laborAmount: 0 } ], selectedProvider: 'Other' }); - + // Act wrapper.vm.forwardButtonAction(); @@ -904,7 +915,7 @@ describe('coverageStatement.vue', () => { expect(wrapper.vm.$router.navigate) .toHaveBeenCalledWith(navigationScenarios.CLICKED_FORWARD_WITH_TPA_ENABLED, undefined); }); - test('If Verified ITAC, selected other shop, and TPA disabled, navigate forward with CLICKED_FORWARD_WITH_TPA_DISABLED scenario', () => { + test('If Verified ITAC, selected other shop, and TPA disabled, navigate forward w/ CLICKED_FORWARD_WITH_TPA_DISABLED', () => { // Arrange const mountOptions = { router: { @@ -912,7 +923,7 @@ describe('coverageStatement.vue', () => { }, mixins: [mockMixin] }; - + const sellingPrice = getRandomInt(100, 500); const deductible = sellingPrice + 1; const mainInitialState = { order: { @@ -922,7 +933,7 @@ describe('coverageStatement.vue', () => { policy: { noCoverage: false, deductible: { - repair: deductible, + repair: deductible }, policyLookupSuccessful: true } @@ -938,37 +949,36 @@ describe('coverageStatement.vue', () => { } })], stubs: { - 'siteFooter': footer, + siteFooter: footerStub, siteHeader: true, recalModal: true, contentGroupModal: true, alert: true, - 'loadingModal': loadingModal + loadingModal: loadingModalStub }, mocks: { $router: { navigate: jest.fn() } } - } + }; const wrapper = mount(coverageStatement, mountOptions); wrapper.setData({ availableLineItems: [ { - sellingPrice: sellingPrice, - kitPrice: 0, - laborAmount: 0, + sellingPrice, + kitPrice: 0, + laborAmount: 0 } ], selectedProvider: 'Other' }); - + // Act wrapper.vm.forwardButtonAction(); // Assert - //expect(wrapper.vm.verifiedITAC).toBeTruthy(); expect(wrapper.vm.$router.navigate) .toHaveBeenCalledWith(navigationScenarios.CLICKED_FORWARD_WITH_TPA_DISABLED, undefined); }); @@ -999,19 +1009,19 @@ describe('coverageStatement.vue', () => { } })], stubs: { - 'siteFooter': footer, + siteFooter: footerStub, siteHeader: true, recalModal: true, contentGroupModal: true, alert: true, - 'loadingModal': loadingModal + loadingModal: loadingModalStub }, mocks: { $router: { navigate: jest.fn() } } - } + }; const wrapper = mount(coverageStatement, mountOptions); wrapper.setData({ @@ -1028,14 +1038,7 @@ describe('coverageStatement.vue', () => { }); }); describe('ADAS', () => { - const loadingModal = { - render: () => {}, - methods: { - showModal: jest.fn(), - hideModal: jest.fn() - } - } - test("if Replace and parts require recalibration, isADAS should return true", () => { + test('if Replace and parts require recalibration, isADAS should return true', () => { // Arrange const mountOptions = { mixins: [mockMixin] @@ -1055,7 +1058,7 @@ describe('coverageStatement.vue', () => { } } }; - + mountOptions.global = { plugins: [createTestingPinia({ initialState: { @@ -1063,14 +1066,14 @@ describe('coverageStatement.vue', () => { } })], stubs: { - 'siteFooter': footer, + siteFooter: footerStub, siteHeader: true, recalModal: true, contentGroupModal: true, alert: true, - 'loadingModal': loadingModal - }, - } + loadingModal: loadingModalStub + } + }; // Act const wrapper = mount(coverageStatement, mountOptions); @@ -1078,7 +1081,7 @@ describe('coverageStatement.vue', () => { // Assert expect(wrapper.vm.isADAS).toBeTruthy(); }); - test("if Replace and parts do not require recalibration, isADAS should return false", () => { + test('if Replace and parts do not require recalibration, isADAS should return false', () => { // Arrange const mountOptions = { mixins: [mockMixin] @@ -1098,7 +1101,7 @@ describe('coverageStatement.vue', () => { } } }; - + mountOptions.global = { plugins: [createTestingPinia({ initialState: { @@ -1106,14 +1109,14 @@ describe('coverageStatement.vue', () => { } })], stubs: { - 'siteFooter': footer, + siteFooter: footerStub, siteHeader: true, recalModal: true, contentGroupModal: true, alert: true, - 'loadingModal': loadingModal - }, - } + loadingModal: loadingModalStub + } + }; // Act const wrapper = mount(coverageStatement, mountOptions); @@ -1121,7 +1124,7 @@ describe('coverageStatement.vue', () => { // Assert expect(wrapper.vm.isADAS).toBeFalsy(); }); - test("if Repair, isADAS should return true", () => { + test('if Repair, isADAS should return true', () => { // Arrange const mountOptions = { mixins: [mockMixin] @@ -1131,10 +1134,10 @@ describe('coverageStatement.vue', () => { order: { damage: { isRepair: true - }, + } } }; - + mountOptions.global = { plugins: [createTestingPinia({ initialState: { @@ -1142,14 +1145,14 @@ describe('coverageStatement.vue', () => { } })], stubs: { - 'siteFooter': footer, + siteFooter: footerStub, siteHeader: true, recalModal: true, contentGroupModal: true, alert: true, - 'loadingModal': loadingModal - }, - } + loadingModal: loadingModalStub + } + }; // Act const wrapper = mount(coverageStatement, mountOptions); @@ -1157,9 +1160,9 @@ describe('coverageStatement.vue', () => { // Assert expect(wrapper.vm.isADAS).toBeFalsy(); }); - }) - describe("claim registration api call", () => { - it("claim registration not required => method not called", async () => { + }); + describe.only('claim registration api call', () => { + it('claim registration not required => method not called', async () => { // Arrange const wrapper = setupMocks({}); @@ -1178,9 +1181,9 @@ describe('coverageStatement.vue', () => { expect(store.registerClaim).not.toHaveBeenCalled(); }); - it("claim registration required => register claim method called", async () => { + it.only('claim registration required => register claim method called', async () => { // Arrange - const sellingPrice = getRandomInt(50,100); + const sellingPrice = getRandomInt(50, 100); const deductible = sellingPrice - 1; const { wrapper } = setupMocks({ }); @@ -1188,12 +1191,12 @@ describe('coverageStatement.vue', () => { await wrapper.setData({ availableLineItems: [ { - sellingPrice: sellingPrice, - kitPrice: 0, - laborAmount: 0, + sellingPrice, + kitPrice: 0, + laborAmount: 0 } ] - }) + }); const store = useMainStore(); store.order.policy.policyLookupSuccessful = true; @@ -1201,9 +1204,9 @@ describe('coverageStatement.vue', () => { store.order.policy.noCoverage = false; store.order.damage.isRepair = true; store.order.policy.deductible.repair = deductible; - + const to = { - query: { issPage: getRandomString(4,10) } + query: { issPage: getRandomString(4, 10) } }; const next = jest.fn(); @@ -1212,61 +1215,5 @@ describe('coverageStatement.vue', () => { // Assert expect(store.registerClaim).toHaveBeenCalled(); }); - }) - -}) - -const mockMixin = { - methods: { - getCmsContent: jest.fn().mockImplementation(() => ''), - setCmsContent: jest.fn(), - }, -}; -const footer = { - render: () => {}, - methods: { - updateButtonText: jest.fn() - } -} - -const loadingModal = { - render: () => {}, - methods: { - showModal: jest.fn(), - hideModal: jest.fn() - } -} - -function setupMocks() -{ - const mountOptions = getMountOptions({ - router: { - navigate: jest.fn() - }, }); - - mountOptions.global = { - stubs: { - 'siteFooter': footer, - siteHeader: true, - recalModal: true, - contentGroupModal: true, - alert: true, - 'loadingModal': loadingModal - }, - } - - mountOptions.mixins = [mockMixin]; - - const apiResponses = { - supportingItems: [], - }; - const apiPromise = Promise.resolve(apiResponses); - settleAllPromises.mockImplementation(() => apiPromise); - fetchCmsContentForPage.mockImplementation(() => Promise.resolve()); - - const wrapper = mount(coverageStatement, mountOptions); - wrapper.vm.$refs.siteFooter.updateButtonText = jest.fn(); - wrapper.vm.$refs.loadingModal.showModal = jest.fn(); - return { wrapper }; -} +});