added test
This commit is contained in:
parent
07cc446039
commit
9413c89607
1 changed files with 27 additions and 0 deletions
|
|
@ -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 = "<p>let's fix your glass</p>";
|
||||
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);
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
Loading…
Reference in a new issue