Skip to content

feat: add "snapshot" function for wrapper elements #198

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

Conversation

flaviohenriquecbc
Copy link
Contributor

What:

When clicking on a wrapper element (e.g. div), it takes a screenshot of the inner elements.

Why:

The idea is to use less the toMatchSnapshot function. In this way, the tests will be more explicit. Something I noticed is that people tend to ignore the snapshots and just update them without thinking about it. This can be an elegant solution to avoid it.

How:

Run getSuggestedQuery to every child of the external wrapper.

Checklist:

  • Tests
  • Ready to be merged

@marcosvega91
Copy link
Member

awesome 💯 I love

thanks for your contribution 🥳

@marcosvega91 marcosvega91 added the feature New feature or request label Jun 18, 2020
@sumeeshn
Copy link

This is neat!!

Copy link
Member

@smeijer smeijer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @flaviohenriquecbc, looking good!

@smeijer smeijer changed the title feat: Add snapshot function for wrapper elements feat: add "snapshot" function for wrapper elements Jun 19, 2020
@smeijer smeijer merged commit 3496ff9 into testing-library:develop Jun 19, 2020
@smeijer
Copy link
Member

smeijer commented Jun 19, 2020

@all-contributors please add @flaviohenriquecbc for code

@allcontributors
Copy link
Contributor

@smeijer

I've put up a pull request to add @flaviohenriquecbc! 🎉

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

Successfully merging this pull request may close these issues.

4 participants