Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stubs to contain events and props #6376

Closed
4 tasks done
steven-twerdochlib opened this issue Aug 21, 2024 · 1 comment
Closed
4 tasks done

stubs to contain events and props #6376

steven-twerdochlib opened this issue Aug 21, 2024 · 1 comment

Comments

@steven-twerdochlib
Copy link

Clear and concise description of the problem

It would be great to be able to test custom components from the template area while stubbed. For example, lets say I have the following: <customComponent @click="runRandomMethod" class="randomClass"><\customComponet> in my class and customComponent.vue has a bunch of properties, mapGetters and methods.
I don't care about the required props in another class or the methods so I would shallowMount it but the issue with this is I can't find the component to trigger a click event that would run "runRandomMethod()". I think it would be nice to somehow keep the events (things that start with @) and keep the props we send (things that start with :) and anything else like class so that we can test if another user accidentally changes something important there e.g. mispelling runRandomMethod.
Let me know if anything I said is confusion I would be happy to elaborate.

Suggested solution

I'm not sure, you would have to change what stubbing returns I guess.

Alternative

No response

Additional context

No response

Validations

@sheremet-va
Copy link
Member

I think you meant to open an issue at https://github.com/vuejs/test-utils. Vitest doesn't provide any way to mount Vue components.

@sheremet-va sheremet-va closed this as not planned Won't fix, can't repro, duplicate, stale Aug 21, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Sep 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants