CSR-254: remove invalid tests / add tests to increase code coverage
This commit is contained in:
parent
a2f7889d95
commit
18a3641a54
1 changed files with 13 additions and 19 deletions
|
|
@ -5,7 +5,6 @@ describe("funnel-footer.vue", () => {
|
||||||
|
|
||||||
it("Should return footer-link class", async () => {
|
it("Should return footer-link class", async () => {
|
||||||
// Act
|
// Act
|
||||||
|
|
||||||
const r = {
|
const r = {
|
||||||
test:"testing",
|
test:"testing",
|
||||||
clientHeight: 10,
|
clientHeight: 10,
|
||||||
|
|
@ -18,43 +17,38 @@ describe("funnel-footer.vue", () => {
|
||||||
|
|
||||||
const wrapper = mount(funnelFooter, {
|
const wrapper = mount(funnelFooter, {
|
||||||
});
|
});
|
||||||
|
wrapper.vm.initializeComponent(cmsContent);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
const link = wrapper.find("a");
|
const link = wrapper.find("a");
|
||||||
console.log(wrapper.html());
|
|
||||||
|
|
||||||
// Expect
|
// Expect
|
||||||
expect(link.attributes('class')).toContain("footer");
|
expect(link.attributes('class')).toContain("footer");
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Should return link text", async () => {
|
it("Should emit ForwardClicked on button click", async () => {
|
||||||
// Act
|
// Act
|
||||||
const wrapper = mount(funnelFooter, {
|
const wrapper = mount(funnelFooter, {
|
||||||
propsData: {
|
|
||||||
text: "Terms of use",
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
wrapper.vm.buttonClick();
|
||||||
// Assert
|
// Assert
|
||||||
const link = wrapper.find("a");
|
expect(wrapper.emitted()["ForwardClicked"][0]).toHaveBeenCalled;
|
||||||
|
|
||||||
expect(link.text()).toEqual("Terms of use");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Should return class btn-primary", async () => {
|
it("Should emit BackClicked on link click", async () => {
|
||||||
// Act
|
// Act
|
||||||
const wrapper = mount(funnelFooter, {
|
const wrapper = mount(funnelFooter, {
|
||||||
propsData: {
|
|
||||||
isPrimary: true,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
wrapper.vm.linkClick();
|
||||||
// Assert
|
// Assert
|
||||||
const input = wrapper.find("button");
|
expect(wrapper.emitted()["BackClicked"][0]).toHaveBeenCalled;
|
||||||
|
|
||||||
// Expect
|
|
||||||
expect(input.attributes("class")).toContain("btn-primary");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//Mock CMS content
|
||||||
|
const cmsContent = {
|
||||||
|
backLink: "text",
|
||||||
|
buttonText: "text",
|
||||||
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue