30 lines
677 B
JavaScript
30 lines
677 B
JavaScript
import { mount } from "@vue/test-utils";
|
|
import funnelFooter from "./funnel-footer";
|
|
|
|
describe("funnel-footer.vue", () => {
|
|
|
|
it("Should return footer-link class", async () => {
|
|
// Act
|
|
try {
|
|
global.document.getElementById = jest.fn().mockImplementation(()=> {
|
|
return {}
|
|
});
|
|
|
|
const wrapper = mount(funnelFooter, {
|
|
propsData: {
|
|
footer: true
|
|
},
|
|
});
|
|
|
|
// Assert
|
|
const link = wrapper.find("a");
|
|
|
|
// Expect
|
|
expect(link.attributes('class')).toContain("footer-link");
|
|
expect(global.document.getElementById).toBeCalled();
|
|
} catch(error) {
|
|
console.log(error);
|
|
}
|
|
|
|
});
|
|
});
|