Skip to main content

vue test: func() = 0% html().toContain

need test default props  without passing any props

test('required props', () => {

const wrapper = mount(Component)
expect(wrapper.props().backgroundColor).toBeTruthy()
expect(wrapper.props().step).toBeTruthy()
expect(wrapper.props().assignedTo).toBeTruthy()
expect(wrapper.props().meetWith).toBeTruthy()
expect(wrapper.props().statuses).toBeTruthy()
expect(wrapper.props().submittable).toBeTruthy()
expect(wrapper.props().editable).toBeTruthy()
expect(wrapper.props().description).toBeTruthy()
const instructions = wrapper.props().instructions
expect(instructions).toBeTruthy()
instructions.forEach(e => {
expect(e.title).toBeTruthy()
expect(e.type).toBeTruthy()
})


expect(wrapper.html()).toContain('<v-treeview-stub active="uuid-4"')

Comments

Popular posts from this blog

check variable undefined with quokka

// listingId = '', 0, null, undefined, false //let listingId if ( typeof listingId === 'undefined' ) console . log ( 'listingId is undefined' ) else console . log ( listingId ) if (!! listingId ) console . log ( listingId ) else console . log ( 'listingId does not found' ) if ( listingId ) console . log ( listingId ) else console . log ( 'listingId does not found' ) if ( listingId === undefined ) console . log ( 'listingId does not found' ) else console . log ( listingId )

lazy loading image - photos carousel

import Carousel from 'react-material-ui-carousel'  https://levelup.gitconnected.com/lazy-loading-images-in-react-for-better-performance-5df73654ea05 < Carousel autoPlay = {false} navButtonsAlwaysVisible = {true} > { ( photos || []). map (( photo , i ) => ( < PhotoViewCard key = { i } photo = { photo } /> )) } </ Carousel >