Skip to content

Allow default stubs to render slot content  #836

@muzafarova

Description

@muzafarova

What problem does this feature solve?

Please check this example: https://codesandbox.io/s/6zmj357qrn

In my app a have pages designed with various layouts, each layout is a component composed of other tiny components (logo, profile, navigation etc.). A page itself is a component matching a route (e.g. /jobs > Jobs);

So I decided to go with slots:
I have a set of "layout" components describing visual wrappers. And a set of "page" components that describe app's routes.

When I test "page" component's logic, I should not care of "layout" (should be tested separately, right?) So I'd really like to use shallowMount everywhere and don't stub all the children. The problem is that shallowMount doesn't seem to allow that, while mount does.

Is there any way to use this technique and still be able to go with shallowMount over mount?

What does the proposed API look like?

Not sure

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions