DigitalConsumer.ISS/src/iss-components/site-sub-header/site-sub-header.spec.js
Johan Gunawan 8ab9838425 SSR-199
2023-01-20 15:30:32 -05:00

26 lines
703 B
JavaScript

import siteSubHeader from '@/iss-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("span");
expect(actual.html()).toContain(subHeaderText);
});
});