diff --git a/src/common-components/funnel-footer/funnel-footer.spec.js b/src/common-components/funnel-footer/funnel-footer.spec.js index f1a885dfd..7528959ff 100644 --- a/src/common-components/funnel-footer/funnel-footer.spec.js +++ b/src/common-components/funnel-footer/funnel-footer.spec.js @@ -57,4 +57,36 @@ describe("funnel-footer.vue", () => { expect(input.attributes("class")).toContain("btn-primary"); }); + it("Should return class justify-content-end if paddingHeight < 80px", async () => { + // Act + const wrapper = mount(funnelFooter, { + propsData: { + footer: true + }, + }); + + // Assert + const stacked = wrapper.find("#stacked"); + wrapper.vm.paddingHeight = 47; + + // Expect + expect(stacked.attributes('class')).toContain("justify-content-end"); + }); + + it("Should return class justify-content-start if paddingHeight > 80px", async () => { + // Act + const wrapper = mount(funnelFooter, { + propsData: { + footer: true + }, + }); + + // Assert + const stacked = wrapper.find("#stacked"); + wrapper.vm.paddingHeight = 100; + + // Expect + expect(stacked.attributes('class')).toContain("justify-content-start"); + }); + }); diff --git a/src/common-components/funnel-footer/funnel-footer.vue b/src/common-components/funnel-footer/funnel-footer.vue index c4b949f78..ac3d97269 100644 --- a/src/common-components/funnel-footer/funnel-footer.vue +++ b/src/common-components/funnel-footer/funnel-footer.vue @@ -69,6 +69,7 @@ export default { setTimeout(function(){ // Give it a moment to set the date document.getElementById('years').innerHTML += new Date().getFullYear(); }, 100); + this.checkHeight(); }, beforeUnmount() { window.removeEventListener('resize', this.onResize); @@ -96,5 +97,6 @@ export default {