Closed ehsan-shv closed 2 years ago
In a situation that we want to test just emitting event to parent, what can we do? For example, we have an event emitter like this: emit('onInputButtonClick'); and this event emitter just emits an event to the parent without sending any data.
emit('onInputButtonClick');
Assert that emitted() contains the expected property, in this case expect(wrapper.emitted().onInputButtonClick).toHaveLength(1).
emitted()
expect(wrapper.emitted().onInputButtonClick).toHaveLength(1)
In a situation that we want to test just emitting event to parent, what can we do? For example, we have an event emitter like this:
emit('onInputButtonClick');
and this event emitter just emits an event to the parent without sending any data.