Skip to content
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

[Chore] Remove third-party testing internals from test snapshots #192747

Merged
merged 2 commits into from
Sep 13, 2024

Conversation

rylnd
Copy link
Contributor

@rylnd rylnd commented Sep 12, 2024

Summary

This removes some indavertent testing of third-party APIs/implementations caused by directly passing the result of a render() call to toMatchSnapshot().

In all cases, this was solved by passing render().container (the root element rendered by the testing library) instead.

These changes remove implementation details of both styled-components (#192368 being the reason for this commit) and testing-library from the snapshots.

Checklist

This removes some indavertent testing of third-party
APIs/implementations by not directly passing the result of a `render()`
call to `toMatchSnapshot()`. In all cases, this was solved by
passing `render().container` (the root element rendered by the
testing library) instead.

These changes remove implementation details of both styled-components
(elastic#192368 being the reason for this commit) and testing-library from the
snapshots.
@rylnd rylnd added chore testing Issues related to tests. labels Sep 12, 2024
@rylnd rylnd marked this pull request as ready for review September 12, 2024 16:52
@rylnd rylnd requested review from a team as code owners September 12, 2024 16:52
@rylnd rylnd added release_note:skip Skip the PR/issue when compiling release notes Team:Detection Engine Security Solution Detection Engine Area labels Sep 12, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detection-engine (Team:Detection Engine)

Copy link
Contributor

@opauloh opauloh left a comment

Choose a reason for hiding this comment

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

LGTM - Thanks!

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@rylnd rylnd merged commit 4efcc28 into elastic:main Sep 13, 2024
38 checks passed
@rylnd rylnd deleted the remove_internals_from_snapshots branch September 13, 2024 22:47
@kibanamachine kibanamachine added v9.0.0 backport:skip This commit does not require backporting labels Sep 13, 2024
markov00 pushed a commit to markov00/kibana that referenced this pull request Sep 18, 2024
…stic#192747)

## Summary

This removes some indavertent testing of third-party
APIs/implementations caused by directly passing the result of a
`render()` call to `toMatchSnapshot()`.

In all cases, this was solved by passing `render().container` (the root
element rendered by the testing library) instead.

These changes remove implementation details of both styled-components
(elastic#192368 being the reason for this commit) and testing-library from the
snapshots.


### Checklist


- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting chore release_note:skip Skip the PR/issue when compiling release notes Team:Detection Engine Security Solution Detection Engine Area testing Issues related to tests. v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants