File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ const wrapper = mount(Component)
1414wrapper .vm .$emit (' foo' )
1515wrapper .vm .$emit (' foo' , 123 )
1616
17+ await wrapper .vm .$nextTick () // Wait until $emits have been handled
18+
1719/*
1820wrapper.emitted() returns the following object:
1921{
Original file line number Diff line number Diff line change 11## trigger
22
3- Triggers an event on the ` Wrapper ` DOM node.
3+ Triggers an event asynchronously on the ` Wrapper ` DOM node.
44
55` trigger ` takes an optional ` options ` object. The properties in the ` options ` object are added to the Event.
66
@@ -31,6 +31,8 @@ wrapper.trigger('click', {
3131 ctrlKey: true // For testing @click.ctrl handlers
3232})
3333
34+ await wrapper .vm .$nextTick () // Wait until trigger events have been handled
35+
3436expect (clickHandler .called ).toBe (true )
3537```
3638
You can’t perform that action at this time.
0 commit comments