You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Call setProps with an object with attributes not defined in the mounted component's props option.
What is expected?
Undefined attributes will be parsed as $attrs in the component, just like what will happen when providing propsData when mounting the component.
What is actually happening?
The following error pops up:
[vue-test-utils]: wrapper.setProps() called with [undefined attribute name] property which is not defined on the component
As Vue 2.4 adds support for $attrs, this inconsistency in vue-test-utils would be annoying when testing a component that uses $attrs. We had to re-mount the component which is not required in actual code, as $attrs is reactive.
The text was updated successfully, but these errors were encountered:
Version
1.0.0-beta.25
Reproduction link
https://vue-test-utils.vuejs.org/api/wrapper/#setprops-props
Steps to reproduce
Call
setProps
with an object with attributes not defined in the mounted component'sprops
option.What is expected?
Undefined attributes will be parsed as
$attrs
in the component, just like what will happen when providingpropsData
when mounting the component.What is actually happening?
The following error pops up:
As Vue 2.4 adds support for
$attrs
, this inconsistency in vue-test-utils would be annoying when testing a component that uses$attrs
. We had to re-mount the component which is not required in actual code, as $attrs is reactive.The text was updated successfully, but these errors were encountered: