Skip to content

Instantly share code, notes, and snippets.

@lmiller1990
Created January 26, 2018 11:13
Show Gist options
  • Save lmiller1990/00e95ac63a2e8b62cf76573679a4a463 to your computer and use it in GitHub Desktop.
Save lmiller1990/00e95ac63a2e8b62cf76573679a4a463 to your computer and use it in GitHub Desktop.
import { shallow } from 'vue-test-utils'
import CreateDescription from './CreateDescription'
describe('CreateDescription', () => {
it('emits a input event with the entered value', () => {
const wrapper = shallow(CreateDescription, {
propsData: {
value: ''
}
})
wrapper.find('textarea').element.value = 'Post'
wrapper.find('textarea').trigger('input')
expect(wrapper.emitted().input[0][0]).toEqual('Post')
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment