Skip to content

Introduce stubComponent helper

Illya Klymov requested to merge xanf/introduce-stub-component into master

What does this MR do?

@vue/test-utils 1.x will change behavior for stubs. Now they will render all available slots instead of defaults. To simplify migration and taking care of emerging pattern of "stubbing with props" we're introducing stubComponent helper, which will copy props and model of stubbed component and also ensure that stubbed component still could be found with default vue-test-utils finders

(this also removes several ugly workarounds in our codebase)

setProps() in vue-test-utils is "partially async" and in 1.x will become more async than now. To be safe and to keep our tests green after migration we need to properly await things

Part of &4255 (closed) effort

#240756 (closed)

Screenshots (strongly suggested)

N/A

Does this MR meet the acceptance criteria?

Conformity

Merge request reports

Loading