DigitalConsumer.FixMyGlass/src/common-components/funnel-footer/funnel-footer.spec.js
2022-02-01 10:37:21 -05:00

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