diff --git a/src/common-components/site-header/menu-modal/menu-modal.spec.js b/src/common-components/site-header/menu-modal/menu-modal.spec.js new file mode 100644 index 00000000..49aa5d3c --- /dev/null +++ b/src/common-components/site-header/menu-modal/menu-modal.spec.js @@ -0,0 +1,51 @@ +import { shallowMount } from "@vue/test-utils"; +import menuModal from "./menu-modal"; + +describe("menu-modal.vue", () => { + it("Should return text Footer Navigation", async () => { + // Act + const wrapper = shallowMount(menuModal); + + // Assert + const footerModalLabel = wrapper.find("h5"); + + // Expect + expect(footerModalLabel.text()).toContain("Footer Navigation"); + }); + + it("Should return footer text as Safelite Group", async () => { + // Act + const wrapper = shallowMount(menuModal); + + // Assert + const modalFooter = wrapper.find("div.modal-footer"); + + // Expect + expect(modalFooter.text()).toContain("Safelite Group"); + }); + + it("Should return Terms of use text link text", async () => { + // Act + const wrapper = shallowMount(menuModal); + + // Expect + expect(wrapper.html()).toContain("Terms of use"); + }); + + it("Should return Privacy policy text link text", async () => { + // Act + const wrapper = shallowMount(menuModal); + + // Expect + expect(wrapper.html()).toContain("Privacy policy"); + }); + + it("Should returnDo not sell my information text link text", async () => { + // Act + const wrapper = shallowMount(menuModal); + + // Expect + expect(wrapper.html()).toContain("Do not sell my information"); + }); + +}); diff --git a/src/common-components/site-header/menu-modal/menu-modal.vue b/src/common-components/site-header/menu-modal/menu-modal.vue new file mode 100644 index 00000000..f43a66e6 --- /dev/null +++ b/src/common-components/site-header/menu-modal/menu-modal.vue @@ -0,0 +1,170 @@ + + + + + + \ No newline at end of file diff --git a/src/common-components/site-header/site-header.vue b/src/common-components/site-header/site-header.vue index 6518f870..76de47be 100644 --- a/src/common-components/site-header/site-header.vue +++ b/src/common-components/site-header/site-header.vue @@ -1,10 +1,12 @@ \ No newline at end of file diff --git a/src/mixins/base-mixin.js b/src/mixins/base-mixin.js index 83fd9097..61a358be 100644 --- a/src/mixins/base-mixin.js +++ b/src/mixins/base-mixin.js @@ -19,6 +19,10 @@ export default { getCmsContent(widgetName, fieldName) { return this.$root.cmsContentByWidget?.[widgetName]?.[fieldName] ? this.$root.cmsContentByWidget[widgetName][fieldName] : ''; }, + getFooterInfoBoxHeight() { + const footerInfoBox = document.querySelector(".footer#infoBox"); + return footerInfoBox ? footerInfoBox.offsetHeight : 0; + }, }, computed: { // store will be accessible globally as its id + 'Store' diff --git a/src/ux-components/text-link/text-link.spec.js b/src/ux-components/text-link/text-link.spec.js new file mode 100644 index 00000000..ab1c21b5 --- /dev/null +++ b/src/ux-components/text-link/text-link.spec.js @@ -0,0 +1,49 @@ +import { shallowMount } from "@vue/test-utils"; +import textLink from "./text-link"; + +describe("text-link.vue", () => { + it("Should return class navigation-link", async () => { + // Act + const wrapper = shallowMount(textLink, { + propsData: { + linkType: "navigation", + }, + }); + + // Assert + const paragraph = wrapper.find("a"); + + // Expect + expect(paragraph.attributes("class")).toContain("navigation-link"); + }); + + it("Should return class footer", async () => { + // Act + const wrapper = shallowMount(textLink, { + propsData: { + linkType: "footer", + }, + }); + + // Assert + const paragraph = wrapper.find("a"); + + // Expect + expect(paragraph.attributes("class")).toContain("footer"); + }); + + it("Should return class text-small", async () => { + // Act + const wrapper = shallowMount(textLink, { + propsData: { + linkType: "textSmall", + }, + }); + + // Assert + const paragraph = wrapper.find("a"); + + // Expect + expect(paragraph.attributes("class")).toContain("small"); + }); +}); diff --git a/src/ux-components/text-link/text-link.vue b/src/ux-components/text-link/text-link.vue new file mode 100644 index 00000000..cd29bcd7 --- /dev/null +++ b/src/ux-components/text-link/text-link.vue @@ -0,0 +1,66 @@ + + + + + + \ No newline at end of file