Skip to content

Comments

[ML] Migrate Enzyme tests to RTL#225423

Merged
rbrtj merged 13 commits intoelastic:mainfrom
rbrtj:ml-migrate-enzyme-tests-to-rtl
Jun 30, 2025
Merged

[ML] Migrate Enzyme tests to RTL#225423
rbrtj merged 13 commits intoelastic:mainfrom
rbrtj:ml-migrate-enzyme-tests-to-rtl

Conversation

@rbrtj
Copy link
Contributor

@rbrtj rbrtj commented Jun 26, 2025

Resolves #223197

@rbrtj rbrtj self-assigned this Jun 26, 2025
@rbrtj rbrtj requested a review from a team as a code owner June 26, 2025 10:01
@rbrtj rbrtj added :ml release_note:skip Skip the PR/issue when compiling release notes Team:ML Team label for ML (also use :ml) t// backport:version Backport to applied version labels v9.1.0 v8.19.0 labels Jun 26, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Deleted this one as it didn't really check anything, this is a more structured component and we have functional tests around outlier detection.

return (
<>
<EuiFlexGroup key={`url_${index}`} data-test-subj={`mlJobEditCustomUrlItem_${index}`}>
<React.Fragment key={`url_${index}`}>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was causing a console warning

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@jgowdyelastic jgowdyelastic left a comment

Choose a reason for hiding this comment

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

LGTM

@rbrtj rbrtj changed the title [ML] Migrate remaining Enzyme tests to RTL [ML] Migrate Enzyme tests to RTL Jun 30, 2025
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
ml 5.4MB 5.4MB -3.0B

Count of Enzyme imports

Enzyme is no longer supported, and we should switch to @testing-library/react instead.

id before after diff
ml 9 0 -9

History

cc @rbrtj

@rbrtj rbrtj merged commit a01759c into elastic:main Jun 30, 2025
10 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19, 9.1

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jun 30, 2025
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.19 Backport failed because of merge conflicts

You might need to backport the following PRs to 8.19:
- Remapping iInCircle and questionInCircle and deprecating help icon (#223142)
9.1

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

Manual backport

To create the backport manually run:

node scripts/backport --pr 225423

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jun 30, 2025
# Backport

This will backport the following commits from `main` to `9.1`:
- [[ML] Migrate `Enzyme` tests to `RTL`
(#225423)](#225423)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Robert
Jaszczurek","email":"92210485+rbrtj@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-06-30T12:10:03Z","message":"[ML]
Migrate `Enzyme` tests to `RTL` (#225423)\n\nResolves
https://github.com/elastic/kibana/issues/223197","sha":"a01759c410312b65134c9daf505d94f8e55b9c44","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":[":ml","release_note:skip","Team:ML","backport:version","v9.1.0","v8.19.0","v9.2.0"],"title":"[ML]
Migrate `Enzyme` tests to
`RTL`","number":225423,"url":"https://github.com/elastic/kibana/pull/225423","mergeCommit":{"message":"[ML]
Migrate `Enzyme` tests to `RTL` (#225423)\n\nResolves
https://github.com/elastic/kibana/issues/223197","sha":"a01759c410312b65134c9daf505d94f8e55b9c44"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/225423","number":225423,"mergeCommit":{"message":"[ML]
Migrate `Enzyme` tests to `RTL` (#225423)\n\nResolves
https://github.com/elastic/kibana/issues/223197","sha":"a01759c410312b65134c9daf505d94f8e55b9c44"}}]}]
BACKPORT-->

Co-authored-by: Robert Jaszczurek <92210485+rbrtj@users.noreply.github.com>
@rbrtj rbrtj added backport:version Backport to applied version labels and removed backport:version Backport to applied version labels labels Jul 2, 2025
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19, 9.1

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 2, 2025
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.19
9.1 Cherrypick failed because the selected commit (a01759c) is empty. It looks like the commit was already backported in #225828

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

Manual backport

To create the backport manually run:

node scripts/backport --pr 225423

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jul 2, 2025
# Backport

This will backport the following commits from `main` to `8.19`:
- [[ML] Migrate `Enzyme` tests to `RTL`
(#225423)](#225423)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Robert
Jaszczurek","email":"92210485+rbrtj@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-06-30T12:10:03Z","message":"[ML]
Migrate `Enzyme` tests to `RTL` (#225423)\n\nResolves
https://github.com/elastic/kibana/issues/223197","sha":"a01759c410312b65134c9daf505d94f8e55b9c44","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":[":ml","release_note:skip","Team:ML","backport:version","v9.1.0","v8.19.0","v9.2.0"],"title":"[ML]
Migrate `Enzyme` tests to
`RTL`","number":225423,"url":"https://github.com/elastic/kibana/pull/225423","mergeCommit":{"message":"[ML]
Migrate `Enzyme` tests to `RTL` (#225423)\n\nResolves
https://github.com/elastic/kibana/issues/223197","sha":"a01759c410312b65134c9daf505d94f8e55b9c44"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/225828","number":225828,"state":"MERGED","mergeCommit":{"sha":"7776cc0162e38bed303dd06b6819667a0e725f64","message":"[9.1]
[ML] Migrate `Enzyme` tests to `RTL` (#225423) (#225828)\n\n#
Backport\n\nThis will backport the following commits from `main` to
`9.1`:\n- [[ML] Migrate `Enzyme` tests to
`RTL`\n(#225423)](https://github.com/elastic/kibana/pull/225423)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by:
Robert Jaszczurek
<92210485+rbrtj@users.noreply.github.com>"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/225423","number":225423,"mergeCommit":{"message":"[ML]
Migrate `Enzyme` tests to `RTL` (#225423)\n\nResolves
https://github.com/elastic/kibana/issues/223197","sha":"a01759c410312b65134c9daf505d94f8e55b9c44"}}]}]
BACKPORT-->

Co-authored-by: Robert Jaszczurek <92210485+rbrtj@users.noreply.github.com>
rbrtj added a commit that referenced this pull request Jul 9, 2025
The previous PR - #225423,
targeted only direct imports from `enzyme`. This PR targets all
occurrences of helper functions that use Enzyme under the hood.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Jul 9, 2025
The previous PR - elastic#225423,
targeted only direct imports from `enzyme`. This PR targets all
occurrences of helper functions that use Enzyme under the hood.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 293bb28)
rbrtj added a commit to rbrtj/kibana that referenced this pull request Jul 9, 2025
The previous PR - elastic#225423,
targeted only direct imports from `enzyme`. This PR targets all
occurrences of helper functions that use Enzyme under the hood.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 293bb28)

# Conflicts:
#	x-pack/platform/plugins/shared/ml/public/application/settings/settings.test.tsx
kertal pushed a commit to kertal/kibana that referenced this pull request Jul 25, 2025
The previous PR - elastic#225423,
targeted only direct imports from `enzyme`. This PR targets all
occurrences of helper functions that use Enzyme under the hood.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels :ml release_note:skip Skip the PR/issue when compiling release notes Team:ML Team label for ML (also use :ml) t// v8.19.0 v9.1.0 v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ML] Migrate jest tests from Enzyme to React Testing Library

5 participants