Comments (3)
Hi @julisch94
Thanks for the repro. I guess this is a problem with JSX (I personally don't use it, and this definitely should work). We don't have a lot of tests with JSX components so maybe this doesn't work.
Would you like to try to open a PR and fix it? A good first step would be to add a unit test to reproduce the issue. Then the issue is probably in https://github.com/vuejs/test-utils/blob/main/src/vnodeTransformers/stubComponentsTransformer.ts.
That would be a great help and we would gladly review and merge it!
from test-utils.
I have tried to solve it by adding a failing test case. I was able to fix one of them by defining a name
inside my component. With that, actually my original bug was solved for me. So no code changes needed.
However, it would be nice if test-utils would be able to determine the component name by itself and just stub it no matter what the name
of the child component is.
I tried to achieve that in #2441 but couldn't manage to solve the failing test. Maybe you can help?
Anyway, for now I'm happy to just add a name
to my JSX component and that will fix it for me. So this has no urgency. Thanks for the help anyways. ❤️
from test-utils.
As discussed in #2441 (comment) I think adding a name is probably the only way for now, except if the JSX plugin decides to more info to the component 👍
from test-utils.
Related Issues (20)
- Bug: Transition - [Vue warn]: Wrong type passed as event handler to xxx - did you forget @ or : in front of your prop? HOT 6
- Bug: Need to preserve code of keydown event
- Bug: TypeScript errors with Vue generic components HOT 3
- Bug: `renderToString` always generates an empty html comment HOT 4
- chrome will remove `DOMXXX` event listeners on July 30 HOT 5
- Bug: Unable to mock original mixin method in the component with Vue 3. HOT 1
- Feature request: setProvide HOT 3
- Bug: There is a type mismatch between the slot parameter inside the mount object and MountingOptions HOT 1
- Bug: ReferenceError: Vue is not defined - Missing exports declaration ? HOT 8
- Bug: Documentation for extending Vue Test Utils has outdated configuration for TypeScript? HOT 1
- Bug: setValue on nested v-model do not correctly update parent
- Docs: incorrect checkbox value check HOT 2
- Bug: TypeScript error when checking wrapper.props().myProperty HOT 2
- Bug: 3.5 alpha type issue
- Feature request: stubs to contain events and props HOT 4
- Bug: ref reactivity isn't maintained when testing HOT 1
- Bug: Cannot destructure property 'createComponentInstance' of 'ssrUtils' as it is undefined.
- Bug: @vue/test-utils doesn't require a specific vue version as peer dependency HOT 5
- Bug: 使用 wrapper.trigger('click') 无法正常触发 el-radio HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from test-utils.