import { shallowMount } from "@vue/test-utils"; import FunnelSubHeader from "./funnel-sub-header"; describe("FunnelSubHeader.vue", () => { it("Should render the 'text' prop value as a span value for the header span text value.", () => { // Act const wrapper = shallowMount(FunnelSubHeader, { propsData: { text: "FunnelSubHeader Content", }, }); // Assert expect(wrapper.find("h2").text()).toContain("FunnelSubHeader Content"); wrapper.unmount(); }); it("Should render the button inside of header if backButtonAction provided", () => { // Act const testFn = () => {} const wrapper = shallowMount(FunnelSubHeader, { propsData: { text: "FunnelSubHeader Content", hasBackButton: true, backButtonAction: testFn, }, }); // Assert expect(wrapper.find("h2").find("button").text()).toContain("FunnelSubHeader Content"); wrapper.unmount(); }); });