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

Mock $refs when rendering shallow component #147

Open
adamyarger opened this issue Oct 3, 2017 · 1 comment
Open

Mock $refs when rendering shallow component #147

adamyarger opened this issue Oct 3, 2017 · 1 comment

Comments

@adamyarger
Copy link

Is there any way to mock or stub $refs when using shallow to render a component?

I have a child component that takes quite a bit to get set up for testing, so using shallow is a nice way to make my tests less brittle. What I've now run into is that the child component is not recognized inside the $refs object. Is there a way to stub or mock a ref when using shallow?

@eddyerburgh
Copy link
Owner

Not currently.

I would happily accept a PR that added a refs option where you could pass an object. Unfortunately I don't have time at the moment to implement it myself 😞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants