Skip to content

[React@18] Refactor overview.tsx test to rtl#206805

Merged
Dosant merged 1 commit intoelastic:mainfrom
Dosant:d/2025-01-15-refactor-overview-test
Jan 16, 2025
Merged

[React@18] Refactor overview.tsx test to rtl#206805
Dosant merged 1 commit intoelastic:mainfrom
Dosant:d/2025-01-15-refactor-overview-test

Conversation

@Dosant
Copy link
Copy Markdown
Contributor

@Dosant Dosant commented Jan 15, 2025

Summary

Extracted from #206411 [job] [logs] Jest Tests #9 / Overview renders correctly when there is no user data view
This simplifies overview.tsx by refactoring to rtl and removing the whole snapshot. The snapshot was not useful and the test is still making sure that the intended component is still rendered. By removing enzyme, the test now works properly for both react 17 and 18.

@Dosant Dosant added release_note:skip Skip the PR/issue when compiling release notes Team:SharedUX Platform AppEx-SharedUX (formerly Global Experience) t// backport:prev-minor React@18 labels Jan 15, 2025
@Dosant Dosant requested a review from a team as a code owner January 15, 2025 15:19
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/appex-sharedux (Team:SharedUX)

@Dosant Dosant changed the title [React@18] Refactor overview.tsx test [React@18] Refactor overview.tsx test to rtl Jan 15, 2025
Copy link
Copy Markdown
Contributor

@eokoneyo eokoneyo left a comment

Choose a reason for hiding this comment

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

Nice!! Code changes LGTM

@Dosant Dosant merged commit bdcad52 into elastic:main Jan 16, 2025
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/12806394788

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 16, 2025
## Summary

Extracted from elastic#206411
[[job]](https://buildkite.com/elastic/kibana-pull-request/builds/267344#019469ff-7fb9-4c5d-8569-2e445aab27be)
[[logs]](https://buildkite.com/organizations/elastic/pipelines/kibana-pull-request/builds/267344/jobs/019469ff-7fb9-4c5d-8569-2e445aab27be/artifacts/01946a1c-62fa-4d30-8863-1b40f8c0b924)
Jest Tests elastic#9 / Overview renders correctly when there is no user data
view
This simplifies overview.tsx by refactoring to rtl and removing the
whole snapshot. The snapshot was not useful and the test is still making
sure that the intended component is still rendered. By removing enzyme,
the test now works properly for both react 17 and 18.

(cherry picked from commit bdcad52)
@kibanamachine
Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jan 16, 2025
# Backport

This will backport the following commits from `main` to `8.x`:
- [[React@18] Refactor overview.tsx test to rtl
(#206805)](#206805)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Anton
Dosov","email":"anton.dosov@elastic.co"},"sourceCommit":{"committedDate":"2025-01-16T09:57:55Z","message":"[React@18]
Refactor overview.tsx test to rtl (#206805)\n\n##
Summary\r\n\r\nExtracted from
https://github.com/elastic/kibana/pull/206411\r\n[[job]](https://buildkite.com/elastic/kibana-pull-request/builds/267344#019469ff-7fb9-4c5d-8569-2e445aab27be)\r\n[[logs]](https://buildkite.com/organizations/elastic/pipelines/kibana-pull-request/builds/267344/jobs/019469ff-7fb9-4c5d-8569-2e445aab27be/artifacts/01946a1c-62fa-4d30-8863-1b40f8c0b924)\r\nJest
Tests #9 / Overview renders correctly when there is no user
data\r\nview\r\nThis simplifies overview.tsx by refactoring to rtl and
removing the\r\nwhole snapshot. The snapshot was not useful and the test
is still making\r\nsure that the intended component is still rendered.
By removing enzyme,\r\nthe test now works properly for both react 17 and
18.","sha":"bdcad52cd8d1569590107a43e3bea7cf25164af9","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:SharedUX","backport:prev-minor","React@18"],"title":"[React@18]
Refactor overview.tsx test to
rtl","number":206805,"url":"https://github.com/elastic/kibana/pull/206805","mergeCommit":{"message":"[React@18]
Refactor overview.tsx test to rtl (#206805)\n\n##
Summary\r\n\r\nExtracted from
https://github.com/elastic/kibana/pull/206411\r\n[[job]](https://buildkite.com/elastic/kibana-pull-request/builds/267344#019469ff-7fb9-4c5d-8569-2e445aab27be)\r\n[[logs]](https://buildkite.com/organizations/elastic/pipelines/kibana-pull-request/builds/267344/jobs/019469ff-7fb9-4c5d-8569-2e445aab27be/artifacts/01946a1c-62fa-4d30-8863-1b40f8c0b924)\r\nJest
Tests #9 / Overview renders correctly when there is no user
data\r\nview\r\nThis simplifies overview.tsx by refactoring to rtl and
removing the\r\nwhole snapshot. The snapshot was not useful and the test
is still making\r\nsure that the intended component is still rendered.
By removing enzyme,\r\nthe test now works properly for both react 17 and
18.","sha":"bdcad52cd8d1569590107a43e3bea7cf25164af9"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/206805","number":206805,"mergeCommit":{"message":"[React@18]
Refactor overview.tsx test to rtl (#206805)\n\n##
Summary\r\n\r\nExtracted from
https://github.com/elastic/kibana/pull/206411\r\n[[job]](https://buildkite.com/elastic/kibana-pull-request/builds/267344#019469ff-7fb9-4c5d-8569-2e445aab27be)\r\n[[logs]](https://buildkite.com/organizations/elastic/pipelines/kibana-pull-request/builds/267344/jobs/019469ff-7fb9-4c5d-8569-2e445aab27be/artifacts/01946a1c-62fa-4d30-8863-1b40f8c0b924)\r\nJest
Tests #9 / Overview renders correctly when there is no user
data\r\nview\r\nThis simplifies overview.tsx by refactoring to rtl and
removing the\r\nwhole snapshot. The snapshot was not useful and the test
is still making\r\nsure that the intended component is still rendered.
By removing enzyme,\r\nthe test now works properly for both react 17 and
18.","sha":"bdcad52cd8d1569590107a43e3bea7cf25164af9"}}]}] BACKPORT-->

Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
viduni94 pushed a commit to viduni94/kibana that referenced this pull request Jan 23, 2025
## Summary

Extracted from elastic#206411
[[job]](https://buildkite.com/elastic/kibana-pull-request/builds/267344#019469ff-7fb9-4c5d-8569-2e445aab27be)
[[logs]](https://buildkite.com/organizations/elastic/pipelines/kibana-pull-request/builds/267344/jobs/019469ff-7fb9-4c5d-8569-2e445aab27be/artifacts/01946a1c-62fa-4d30-8863-1b40f8c0b924)
Jest Tests elastic#9 / Overview renders correctly when there is no user data
view
This simplifies overview.tsx by refactoring to rtl and removing the
whole snapshot. The snapshot was not useful and the test is still making
sure that the intended component is still rendered. By removing enzyme,
the test now works properly for both react 17 and 18.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

React@18 release_note:skip Skip the PR/issue when compiling release notes Team:SharedUX Platform AppEx-SharedUX (formerly Global Experience) t// v8.18.0 v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants