CSR-254: remove invalid tests / add tests to increase code coverage

This commit is contained in:
Adam Caouette 2022-02-11 17:02:17 -05:00
parent a2f7889d95
commit 18a3641a54

View file

@ -5,7 +5,6 @@ describe("funnel-footer.vue", () => {
it("Should return footer-link class", async () => {
// Act
const r = {
test:"testing",
clientHeight: 10,
@ -18,43 +17,38 @@ describe("funnel-footer.vue", () => {
const wrapper = mount(funnelFooter, {
});
wrapper.vm.initializeComponent(cmsContent);
// Assert
const link = wrapper.find("a");
console.log(wrapper.html());
// Expect
expect(link.attributes('class')).toContain("footer");
});
it("Should return link text", async () => {
it("Should emit ForwardClicked on button click", async () => {
// Act
const wrapper = mount(funnelFooter, {
propsData: {
text: "Terms of use",
},
});
wrapper.vm.buttonClick();
// Assert
const link = wrapper.find("a");
expect(link.text()).toEqual("Terms of use");
expect(wrapper.emitted()["ForwardClicked"][0]).toHaveBeenCalled;
});
it("Should return class btn-primary", async () => {
it("Should emit BackClicked on link click", async () => {
// Act
const wrapper = mount(funnelFooter, {
propsData: {
isPrimary: true,
},
});
wrapper.vm.linkClick();
// Assert
const input = wrapper.find("button");
// Expect
expect(input.attributes("class")).toContain("btn-primary");
expect(wrapper.emitted()["BackClicked"][0]).toHaveBeenCalled;
});
});
//Mock CMS content
const cmsContent = {
backLink: "text",
buttonText: "text",
};