diff --git a/src/common-components/funnel-footer/funnel-footer.spec.js b/src/common-components/funnel-footer/funnel-footer.spec.js index b6833ef7e..1c173b6be 100644 --- a/src/common-components/funnel-footer/funnel-footer.spec.js +++ b/src/common-components/funnel-footer/funnel-footer.spec.js @@ -12,7 +12,7 @@ describe("funnel-footer.vue", () => { offsetHeight: 24, }; - global.document.getElementById = jest.fn().mockImplementation(()=> { + global.document.querySelector = jest.fn().mockImplementation(()=> { return r; }); diff --git a/src/common-components/funnel-footer/funnel-footer.vue b/src/common-components/funnel-footer/funnel-footer.vue index 424e524fc..47dff7b5a 100644 --- a/src/common-components/funnel-footer/funnel-footer.vue +++ b/src/common-components/funnel-footer/funnel-footer.vue @@ -42,14 +42,12 @@ export default { paddingHeight: 0, backLink: "", buttonText: "", - currentYear: new Date().getFullYear(), } }, mounted() { - this.paddingHeight = document.getElementById("infoBox").offsetHeight + 24; + this.paddingHeight = document.querySelector(".footer #infoBox").offsetHeight + 24; this.$nextTick(() => { window.addEventListener('resize', this.onResize); - this.checkHeight(); }) }, beforeUnmount() { @@ -57,12 +55,7 @@ export default { }, methods: { onResize() { - this.paddingHeight = document.getElementById("infoBox").offsetHeight; - this.checkHeight(); - }, - checkHeight() { - const parentHeight = document.getElementById('infoBox').clientHeight; - const wrapper2 = document.getElementById('stacked'); + this.paddingHeight = document.querySelector(".footer #infoBox").offsetHeight; }, initializeComponent(cmsContent) { this.backLink = cmsContent.BackButtonText;