Skip to content

Allow default stubs to render slot content #836

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

Closed
muzafarova opened this issue Jul 19, 2018 · 1 comment
Closed

Allow default stubs to render slot content #836

muzafarova opened this issue Jul 19, 2018 · 1 comment

Comments

@muzafarova
Copy link

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

@eddyerburgh
Copy link
Member

This is actualy already implemented by #782!

This will be released in beta.21 which will be published within a week.

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