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 56e483b6d..424e524fc 100644 --- a/src/common-components/funnel-footer/funnel-footer.vue +++ b/src/common-components/funnel-footer/funnel-footer.vue @@ -16,10 +16,10 @@
-
+
-
+
@@ -63,15 +63,6 @@ export default { checkHeight() { const parentHeight = document.getElementById('infoBox').clientHeight; const wrapper2 = document.getElementById('stacked'); - console.log(parentHeight); - - if (parentHeight > 80) { - wrapper2.classList.add("justify-content-start","w-100"); - wrapper2.classList.remove("justify-content-end","w-auto"); - } else { - wrapper2.classList.add("justify-content-end"); - wrapper2.classList.remove("justify-content-start"); - } }, initializeComponent(cmsContent) { this.backLink = cmsContent.BackButtonText; @@ -91,9 +82,19 @@ export default { .footer { display: flex; margin-top: auto; - button { - min-width: 135px; + .button-col, + .link-col, + .btn-primary { width: 100%; } + @media only screen and (min-width: 340px) { + .button-col, + .link-col { + width: 50% !important; + } + .btn-primary { + width: auto; + } + } } 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/styles/common-styles.scss b/src/styles/common-styles.scss index 8d7133884..ae409dd36 100644 --- a/src/styles/common-styles.scss +++ b/src/styles/common-styles.scss @@ -6,7 +6,6 @@ body { .container-fluid { max-width: 576px; //Remove once desktop app is complete - // min-width: 360px; &.container-shadow { box-shadow: 0px 0px 6px 0px rgba(0,0,0,0.15); //Use instead of Bootstrap's helper } diff --git a/src/ux-components/button-main/button-main.vue b/src/ux-components/button-main/button-main.vue index e44550c30..2a4a68366 100644 --- a/src/ux-components/button-main/button-main.vue +++ b/src/ux-components/button-main/button-main.vue @@ -1,5 +1,5 @@