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 () => {
|
||||
// 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",
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue