DEV Community

Discussion on: TIL - Vue.js Event Bus more clearly

Collapse
 
rizkmeriouli profile image
Rizk MERIOULI

Hello, Terrierscript.
could you please guide me to test this modal vuejs component with JEST ?

import Vue from 'vue'
import { TeamMember } from '@/components/TeamMember.vue'
import { mount } from "@vue/test-utils"

describe('TeamMember.vue', ()=>{
it('renders a link', () => {
const wrapper = mount(TeamMember)
expect(wrapper.text(true)).toEqual(true)
})
})

Collapse
 
terrierscript profile image
terrierscript

Sorry for late ( I missed this comment.)

Hmm, this solution is un-test friendly ( I noticed this now )

If I need test this, I mocked ModalEvent.
use with jestjs.io/docs/en/manual-mocks#moc... or sinonjs.org/