Skip to content

Mock $refs when rendering shallow component #147

@adamyarger

Description

@adamyarger

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?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions