From 9413c89607b5a451b6791647335f351e719abd06 Mon Sep 17 00:00:00 2001 From: Jason Wheeler Date: Tue, 25 Oct 2022 09:48:07 -0400 Subject: [PATCH] added test --- .../site-sub-header/site-sub-header.spec.js | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/common-components/site-sub-header/site-sub-header.spec.js diff --git a/src/common-components/site-sub-header/site-sub-header.spec.js b/src/common-components/site-sub-header/site-sub-header.spec.js new file mode 100644 index 00000000..ff5f2d5e --- /dev/null +++ b/src/common-components/site-sub-header/site-sub-header.spec.js @@ -0,0 +1,27 @@ +import siteSubHeader from '@/common-components/site-sub-header/site-sub-header'; +import { shallowMount } from "@vue/test-utils"; + +describe("site sub header", () => { + + const subHeaderText = "

let's fix your glass

"; + const mockMixin = { + methods: { + getCmsContent: jest.fn().mockImplementation(()=> { + return subHeaderText; + }) + } + } + + it("should contain the cms content", () => { + const wrapper = shallowMount(siteSubHeader, { + mixins: [mockMixin] + }); + + wrapper.getCmsContent = jest.fn(); + const actual = wrapper.find("p"); + + expect(actual.html()).toBe(subHeaderText); + }) + +}); +