diff --git a/src/common-components/funnel-footer/funnel-footer.spec.js b/src/common-components/funnel-footer/funnel-footer.spec.js index a4c127a3e..b6833ef7e 100644 --- a/src/common-components/funnel-footer/funnel-footer.spec.js +++ b/src/common-components/funnel-footer/funnel-footer.spec.js @@ -9,10 +9,7 @@ describe("funnel-footer.vue", () => { const r = { test:"testing", clientHeight: 10, - classList: { - add: jest.fn(() => ''), - remove: jest.fn() - }, + offsetHeight: 24, }; global.document.getElementById = jest.fn().mockImplementation(()=> { @@ -27,10 +24,7 @@ describe("funnel-footer.vue", () => { console.log(wrapper.html()); // Expect - expect(link.attributes('class')).toContain("footer-link"); - expect(global.document.getElementById).toBeCalled(); - expect(r.classList.add).toBeCalledWith("justify-content-end"); - expect(r.classList.remove).toBeCalledWith("justify-content-start"); + expect(link.attributes('class')).toContain("footer"); }); @@ -63,32 +57,4 @@ describe("funnel-footer.vue", () => { expect(input.attributes("class")).toContain("btn-primary"); }); - it("Should return class justify-content-end if paddingHeight < 80px", async () => { - - global.document.getElementById = jest.fn().mockImplementation(()=> { - return { - test:"testing", - clientHeight: 10, - classList: { - add: jest.fn(), - remove: jest.fn() - } - } - }); - - // Act - const wrapper = mount(funnelFooter, { - propsData: { - footer: true - }, - }); - const infoBox = document.getElementById('infoBox'); - // Assert - const stacked = wrapper.find("#stacked"); - wrapper.vm.paddingHeight = 100; - - // Expect - expect(stacked.attributes('class')).toContain("justify-content-end"); - }); - }); diff --git a/src/common-components/funnel-footer/funnel-footer.vue b/src/common-components/funnel-footer/funnel-footer.vue index 37879d2cf..424e524fc 100644 --- a/src/common-components/funnel-footer/funnel-footer.vue +++ b/src/common-components/funnel-footer/funnel-footer.vue @@ -1,28 +1,30 @@ diff --git a/src/layouts/vehicle-damage/vehicle-damage.spec.js b/src/layouts/vehicle-damage/vehicle-damage.spec.js index 49df756c2..949f4811b 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.spec.js +++ b/src/layouts/vehicle-damage/vehicle-damage.spec.js @@ -1,6 +1,7 @@ // Components import vehicleDamage from "@/layouts/vehicle-damage/vehicle-damage.vue"; import funnelHeader from "@/common-components/funnel-header/funnel-header"; +import funnelFooter from "@/common-components/funnel-footer/funnel-footer"; import vehicleBanner from "@/common-components/vehicle-banner/vehicle-banner"; import funnelSubHeader from "@/common-components/funnel-sub-header/funnel-sub-header"; import replaceOptionsQuestion from "@/layouts/vehicle-damage/replace-options-question/replace-options-question"; @@ -144,7 +145,7 @@ describe("vehicle-damage.vue", () => { describe("vehicle-damage.vue", () => { test("Call invalidation, ResetPartsAndDeps should be called", async () => { - + //Arrange const { wrapper } = setupMocks({}); @@ -221,6 +222,10 @@ function setupMocks({ damageLocationQuestion.methods = { initializeComponent: jest.fn(), + }; + + funnelFooter.methods = { + initializeComponent: jest.fn(), } const mountOptions = getMountOptions(mountOptionsMockData); @@ -252,5 +257,11 @@ function setupMocks({ damageLocationQuestionWrapper.vm.initializeComponent = damageLocationQuestion.methods.initializeComponent; + const funnelFooterWrapper = wrapper.findComponent({ + name: "funnelFooter", + }); + + funnelFooterWrapper.vm.initializeComponent = funnelFooter.methods.initializeComponent; + return { wrapper, apiPromise }; } diff --git a/src/layouts/vehicle-damage/vehicle-damage.vue b/src/layouts/vehicle-damage/vehicle-damage.vue index c5b8df783..b59798e2e 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.vue +++ b/src/layouts/vehicle-damage/vehicle-damage.vue @@ -1,16 +1,18 @@