DigitalConsumer.FixMyGlass/src/common-components/funnel-sub-header/funnel-sub-header.spec.js
2021-12-20 14:58:04 -05:00

32 lines
957 B
JavaScript

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();
});
});