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
In the tests of our project, we shallowMount a component with many sub components. One of these sub component receives a complex property. The property is however not part of the sub component, but part of a mixin. We want to test that the complex property, which contains a function call, works correctly.
Currently, the property is registered as an attribute on the stub as it is not recognised as a property. This doesn't allow us to call the function and test that it is passed correctly.
We use a workaround and register the mixin globally for the test case to be able to test the property as we do not want to mount the whole component with all its sub components. However, this leads to Vue warnings that a required property is missing for all other sub components.
What does the proposed API look like?
We suggest to allow stubbed component to receive any properties no matter whether they are part of the stubbed component or not to make it easier to test properties of mixins.
The text was updated successfully, but these errors were encountered:
We realised that this is even more important with Vuetify components. Components such as v-select do not have any properties as they are all part of mixins. So there is no good solution to test whether the right properties are passed.
What problem does this feature solve?
In the tests of our project, we shallowMount a component with many sub components. One of these sub component receives a complex property. The property is however not part of the sub component, but part of a mixin. We want to test that the complex property, which contains a function call, works correctly.
Currently, the property is registered as an attribute on the stub as it is not recognised as a property. This doesn't allow us to call the function and test that it is passed correctly.
Here is a small working example to make the problem more clear: https://github.com/miriamgreis/vue-test-utils-getting-started
We use a workaround and register the mixin globally for the test case to be able to test the property as we do not want to mount the whole component with all its sub components. However, this leads to Vue warnings that a required property is missing for all other sub components.
What does the proposed API look like?
We suggest to allow stubbed component to receive any properties no matter whether they are part of the stubbed component or not to make it easier to test properties of mixins.
The text was updated successfully, but these errors were encountered: