Created
July 21, 2017 16:10
-
-
Save eddyerburgh/8e1575b5da78985ee41cc18e784853dd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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