You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{shallowMount}from"@vue/test-utils";importOnlinePagefrom"../../../modules/online/views/OnlinePage.vue";describe("Test suite OnlinePage component",()=>{letwrapper;beforeEach(()=>{wrapper=shallowMount(OnlinePage,{});});test("should exist element defined",()=>{expect(wrapper.element).toBeDefined();});});
// Test fileimport{shallowMount}from"@vue/test-utils";importOnlinePagefrom"../../../modules/online/views/OnlinePage.vue";describe("Test suite OnlinePage component",()=>{letwrapper;beforeEach(()=>{wrapper=shallowMount(OnlinePage,{});});test("should show content when showContent is true",()=>{expect(wrapper.find('div').text()).toBe('Content');});test("should not show content when showContent is false",async()=>{awaitwrapper.setData({showContent: false});expect(wrapper.find('div').text()).toBe('No Content');});});
Why I cannot achieve the 100% coverage of branches?
I don't know what I'm missing here.
Component.
Test file
My setup
I also tried to add some methods and logic to the component and still in those cases I'm unable to achieve 100%. There's always a missing branch.
The text was updated successfully, but these errors were encountered: