Skip to content

Slot with only text doesn't render in Jest snapshot #718

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
tonimc opened this issue Jun 14, 2018 · 4 comments
Closed

Slot with only text doesn't render in Jest snapshot #718

tonimc opened this issue Jun 14, 2018 · 4 comments

Comments

@tonimc
Copy link

tonimc commented Jun 14, 2018

Version

1.0.0-beta.18

Reproduction link

https://codesandbox.io/s/w72rz7wl7k

Steps to reproduce

I have a button component with a default slot (maybe the same happens with named slots), in this slot I set the text of the button. When I run my test the snapshot doesn't match with the previous snaps (generated with the previous version of vue-test-utils 1.0.0beta.17) because the slot not set the text provided, as If I didn't specify any slot.
In my component, more complex than what I've created on the codesadbox, on the slot, it render a <div/>

What is expected?

Get a snapshot with the text in the slot area.

What is actually happening?

the slot is empty or a <div /> (this happen in my context, not in codesandbox, in which comes empty)

But if you see the component working on the main.js button it's render as I expected.


If in the default slot I set <p>test</p> it works fine (test also provided on codesandbox)

@eddyerburgh
Copy link
Member

Thanks for the bug report and reproduction. This issue has already been reported and fixed (#707).

It will be in the beta.19 which will be released in a few hours

@tonimc
Copy link
Author

tonimc commented Jun 15, 2018

Thanks, @eddyerburgh and sorry because I didn't search on closed issues.

@chenxeed
Copy link

Hi,

I still find this same issue even when I already in version 1.0.0-beta-24 now.

@eddyerburgh
Copy link
Member

Hi @chenxeed , can you create a new issue with a minimal reproduction?

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

No branches or pull requests

3 participants