Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions packages/test-utils/src/wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,11 @@ export default class Wrapper implements BaseWrapper {
// $FlowIgnore : Problem with possibly null this.vm
this.vm.$options.methods[key] = methods[key]
})

if (this.vnode) {
const context = this.vnode.context
if (context.$options.render) context._update(context._render())
}
}

/**
Expand Down Expand Up @@ -743,13 +748,6 @@ export default class Wrapper implements BaseWrapper {
eventObject.keyCode = modifiers[event[1]]
}

// If this element's event handler has been reset by setMethod, it won't trigger
// Make sure that this element is updated with the latest event handler
if (this.vnode) {
const context = this.vnode.context
if (context.$options.render) context._update(context._render())
}

this.element.dispatchEvent(eventObject)
if (this.vnode) {
orderWatchers(this.vm || this.vnode.context.$root)
Expand Down