-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
[ML] Update jest test for FieldTypeIcon #152019
Conversation
Pinging @elastic/ml-ui (:ml) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to see the migration from enzyme to testing-lib. Maybe we can also use this opportunity and get rid of the whole snapshot and instead just make an assertion about some content we'd expect to show up like the tooltip content.
Nit: The test function names are now not consistent, the new ones use it
, the existing one with the snapshot uses test
.
@walterra Thanks for the suggestion. Made the updates here |
The tests now query the EUI classes |
@@ -94,11 +94,11 @@ export function FieldIcon({ | |||
return ( | |||
<EuiToken | |||
{...token} | |||
className={classNames('kbnFieldIcon', className)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Data Discovery team was notified due to changes to this file, but it doesn't look like anything changed here other than the order of props. Is this intentional or just leftover from temporary changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davismcphee You're right, the original change that triggered ownership review was reverted. Apologies for the ping.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great now, thanks for updating it, LGTM!
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Async chunks
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @qn895 |
(cherry picked from commit c2161fe)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `8.7`: - [[ML] Update jest test for FieldTypeIcon (#152019)](#152019) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Quynh Nguyen (Quinn)","email":"43350163+qn895@users.noreply.github.com"},"sourceCommit":{"committedDate":"2023-03-02T16:16:48Z","message":"[ML] Update jest test for FieldTypeIcon (#152019)","sha":"c2161fe3b16ba4163619a77c38dbfae0b98d9f4b","branchLabelMapping":{"^v8.8.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":[":ml","release_note:skip","Feature:File and Index Data Viz","v8.7.0","v8.8.0"],"number":152019,"url":"#152019 Update jest test for FieldTypeIcon (#152019)","sha":"c2161fe3b16ba4163619a77c38dbfae0b98d9f4b"}},"sourceBranch":"main","suggestedTargetBranches":["8.7"],"targetPullRequestStates":[{"branch":"8.7","label":"v8.7.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.8.0","labelRegex":"^v8.8.0$","isSourceBranch":true,"state":"MERGED","url":"#152019 Update jest test for FieldTypeIcon (#152019)","sha":"c2161fe3b16ba4163619a77c38dbfae0b98d9f4b"}}]}] BACKPORT--> Co-authored-by: Quynh Nguyen (Quinn) <43350163+qn895@users.noreply.github.com>
Summary
Part of #147170. This PR updates the failing test for FieldTypeIcon, which was previously broken because it tested for number of children instead of the content. This PR fixes so that it:
tooltipEnabled == false
.tooltipEnabled == true
.Checklist