Skip to content

Instantly share code, notes, and snippets.

@eddyerburgh
Created July 21, 2017 16:10
Show Gist options
  • Save eddyerburgh/8e1575b5da78985ee41cc18e784853dd to your computer and use it in GitHub Desktop.
Save eddyerburgh/8e1575b5da78985ee41cc18e784853dd to your computer and use it in GitHub Desktop.
import { mount } from 'vue-test-utils'
import ComponentWithSlots from '@/components/ComponentWithSlots'
import AnotherComponent from '@/components/AnotherComponent'
// mount the component with options
const wrapper = mount(ComponentWithSlots, {
slots: {
default: 'div'
},
propsData: {
aProp: true
}
})
// traverse the VDOM
const anotherComponent = wrapper.find(AnotherComponent)
// make assertions
expect(anotherComponent.hasProp('foo', 'bar')).to.equal(true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment