Component is being rendered but while testing it fails

Viewed 64

While debugging, component is being rendered(also in webpage) but while testing if the component exists or not, assertion is failing. NOTE : Title and Top assertions are rendering thus assertion also pass but Tab assertion is failing

Test :

describe("Transaction", () => {
    let wrapper;
    let status = false;
    beforeEach(() => {
        wrapper = mount(TransactionList, {
            localVue,
            vuetify,
            i18n,
            store,
            router
        });
    });
    
    it("Title, Top and Tab components should render", () => {
        expect(wrapper.find({ name: "Title" }).exists()).toBe(true);
        expect(wrapper.find({ name: "Top" }).exists()).toBe(true);
        expect(wrapper.find({ name: "Tab" }).exists()).toBe(true);  // Assertion Failure
    });

Component :

<template>
       <Title/>
       <Top />
       <Tab />
   </template>
0 Answers
Related