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{mount,VueWrapper}from'@vue/test-utils';importLogoutBtnfrom'./LogoutBtn.vue';import{Plugin}from'vue';describe('LogoutBtn',()=>{letwrapper: VueWrapper;constcreateComponent=<T>(options: T,store?: Plugin)=>{wrapper=mount(LogoutBtn,{
...options,global: {plugins: [store],},shallow: true,});};afterEach(()=>{wrapper.unmount();});it('Call logout action on btn click',async()=>{constlogout=jest.fn();createComponent({});// TODO: how to mock store ? how to check logout call ?expect(logout).toHaveBeenCalled();});});
The text was updated successfully, but these errors were encountered:
Hi! Could you please give an example of how to test components using "Method Style Access"? I can't figure out how I can do this:(
pre requirements:
A simple example below
store module:
component:
Test
The text was updated successfully, but these errors were encountered: