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

[Lens] rewrite BucketNestingEditor tests to use react testing library #199888

Merged
merged 5 commits into from
Nov 18, 2024

Conversation

kyracho
Copy link
Contributor

@kyracho kyracho commented Nov 12, 2024

Summary

Hi! This PR rewrites the BucketNestingEditor tests to use the react testing library.

Fixes #199839

Screenshot 2024-11-12 at 3 35 06 PM

Checklist

@kyracho kyracho requested a review from a team as a code owner November 12, 2024 23:38
@mbondyra mbondyra added Team:Visualizations Visualization editors, elastic-charts and infrastructure release_note:skip Skip the PR/issue when compiling release notes labels Nov 13, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-visualizations (Team:Visualizations)

@mbondyra mbondyra added the backport:version Backport to applied version labels label Nov 13, 2024
.first()
.simulate('click');

fireEvent.click(screen.getByTestId('indexPattern-nesting-switch'));
Copy link
Contributor

@mbondyra mbondyra Nov 13, 2024

Choose a reason for hiding this comment

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

Nice improvement!
Would it be possible to make the whole test function async and then use

Suggested change
fireEvent.click(screen.getByTestId('indexPattern-nesting-switch'));
await userEvent.click(screen.getByTestId('indexPattern-nesting-switch'));

(same for the other tests that use events)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are updated and pass much quicker now:
Screenshot 2024-11-15 at 3 23 56 PM
Thanks! 😊

Copy link
Contributor

Choose a reason for hiding this comment

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

Amazing! I'll go ahead and approve it now, thank you for all the hard work 🥇

@mbondyra
Copy link
Contributor

run docs-build

@mbondyra
Copy link
Contributor

buildkite test this

@mbondyra mbondyra changed the title rewrite BucketNestingEditor tests to use react testing library [Lens] rewrite BucketNestingEditor tests to use react testing library Nov 13, 2024
@kyracho kyracho force-pushed the rewrite_bucketnestingeditor_tests branch from 24ef29d to e8de359 Compare November 15, 2024 23:22
@mbondyra
Copy link
Contributor

run docs-build

@mbondyra
Copy link
Contributor

buildkite test this

@mbondyra mbondyra enabled auto-merge (squash) November 18, 2024 14:59
@mbondyra mbondyra merged commit eddfe5b into elastic:main Nov 18, 2024
21 checks passed
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

@kyracho kyracho deleted the rewrite_bucketnestingeditor_tests branch November 18, 2024 17:12
jesuswr pushed a commit to jesuswr/kibana that referenced this pull request Nov 18, 2024
…elastic#199888)

## Summary

Hi! This PR rewrites the `BucketNestingEditor` tests to use the react
testing library.

Fixes elastic#199839 

<img width="1063" alt="Screenshot 2024-11-12 at 3 35 06 PM"
src="https://github.com/user-attachments/assets/95036fe0-46e8-4bf2-9d77-31d225d38ed1">

### Checklist

- [n/a] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

---------

Co-authored-by: Marta Bondyra <[email protected]>
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 199888 locally

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Nov 19, 2024
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 199888 locally

2 similar comments
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 199888 locally

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 199888 locally

mbondyra pushed a commit to mbondyra/kibana that referenced this pull request Nov 25, 2024
…elastic#199888)

## Summary

Hi! This PR rewrites the `BucketNestingEditor` tests to use the react
testing library.

Fixes elastic#199839

<img width="1063" alt="Screenshot 2024-11-12 at 3 35 06 PM"
src="https://github.com/user-attachments/assets/95036fe0-46e8-4bf2-9d77-31d225d38ed1">

### Checklist

- [n/a] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

---------

Co-authored-by: Marta Bondyra <[email protected]>
(cherry picked from commit eddfe5b)
@mbondyra
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x
8.17

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

Questions ?

Please refer to the Backport tool documentation

mbondyra pushed a commit to mbondyra/kibana that referenced this pull request Nov 25, 2024
…elastic#199888)

## Summary

Hi! This PR rewrites the `BucketNestingEditor` tests to use the react
testing library.

Fixes elastic#199839

<img width="1063" alt="Screenshot 2024-11-12 at 3 35 06 PM"
src="https://github.com/user-attachments/assets/95036fe0-46e8-4bf2-9d77-31d225d38ed1">

### Checklist

- [n/a] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

---------

Co-authored-by: Marta Bondyra <[email protected]>
(cherry picked from commit eddfe5b)
@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

mbondyra added a commit that referenced this pull request Nov 26, 2024
…ibrary (#199888) (#201529)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Lens] rewrite BucketNestingEditor tests to use react testing library
(#199888)](#199888)

<!--- Backport version: 8.9.8 -->

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

<!--BACKPORT [{"author":{"name":"Kyra
Cho","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-18T16:46:33Z","message":"[Lens]
rewrite BucketNestingEditor tests to use react testing library
(#199888)\n\n## Summary\r\n\r\nHi! This PR rewrites the
`BucketNestingEditor` tests to use the react\r\ntesting
library.\r\n\r\nFixes #199839 \r\n\r\n<img width=\"1063\"
alt=\"Screenshot 2024-11-12 at 3 35
06 PM\"\r\nsrc=\"https://github.com/user-attachments/assets/95036fe0-46e8-4bf2-9d77-31d225d38ed1\">\r\n\r\n###
Checklist\r\n\r\n- [n/a] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n\r\n---------\r\n\r\nCo-authored-by:
Marta Bondyra
<[email protected]>","sha":"eddfe5b8a73ac636d5e75606280bd771a01b1adb","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Visualizations","release_note:skip","backport
missing","💝community","v9.0.0","backport:version"],"number":199888,"url":"https://github.com/elastic/kibana/pull/199888","mergeCommit":{"message":"[Lens]
rewrite BucketNestingEditor tests to use react testing library
(#199888)\n\n## Summary\r\n\r\nHi! This PR rewrites the
`BucketNestingEditor` tests to use the react\r\ntesting
library.\r\n\r\nFixes #199839 \r\n\r\n<img width=\"1063\"
alt=\"Screenshot 2024-11-12 at 3 35
06 PM\"\r\nsrc=\"https://github.com/user-attachments/assets/95036fe0-46e8-4bf2-9d77-31d225d38ed1\">\r\n\r\n###
Checklist\r\n\r\n- [n/a] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n\r\n---------\r\n\r\nCo-authored-by:
Marta Bondyra
<[email protected]>","sha":"eddfe5b8a73ac636d5e75606280bd771a01b1adb"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199888","number":199888,"mergeCommit":{"message":"[Lens]
rewrite BucketNestingEditor tests to use react testing library
(#199888)\n\n## Summary\r\n\r\nHi! This PR rewrites the
`BucketNestingEditor` tests to use the react\r\ntesting
library.\r\n\r\nFixes #199839 \r\n\r\n<img width=\"1063\"
alt=\"Screenshot 2024-11-12 at 3 35
06 PM\"\r\nsrc=\"https://github.com/user-attachments/assets/95036fe0-46e8-4bf2-9d77-31d225d38ed1\">\r\n\r\n###
Checklist\r\n\r\n- [n/a] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n\r\n---------\r\n\r\nCo-authored-by:
Marta Bondyra
<[email protected]>","sha":"eddfe5b8a73ac636d5e75606280bd771a01b1adb"}}]}]
BACKPORT-->

Co-authored-by: Kyra Cho <[email protected]>
mbondyra added a commit that referenced this pull request Nov 26, 2024
…library (#199888) (#201530)

# Backport

This will backport the following commits from `main` to `8.17`:
- [[Lens] rewrite BucketNestingEditor tests to use react testing library
(#199888)](#199888)

<!--- Backport version: 8.9.8 -->

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

<!--BACKPORT [{"author":{"name":"Kyra
Cho","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-18T16:46:33Z","message":"[Lens]
rewrite BucketNestingEditor tests to use react testing library
(#199888)\n\n## Summary\r\n\r\nHi! This PR rewrites the
`BucketNestingEditor` tests to use the react\r\ntesting
library.\r\n\r\nFixes #199839 \r\n\r\n<img width=\"1063\"
alt=\"Screenshot 2024-11-12 at 3 35
06 PM\"\r\nsrc=\"https://github.com/user-attachments/assets/95036fe0-46e8-4bf2-9d77-31d225d38ed1\">\r\n\r\n###
Checklist\r\n\r\n- [n/a] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n\r\n---------\r\n\r\nCo-authored-by:
Marta Bondyra
<[email protected]>","sha":"eddfe5b8a73ac636d5e75606280bd771a01b1adb","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Visualizations","release_note:skip","backport
missing","💝community","v9.0.0","backport:version"],"number":199888,"url":"https://github.com/elastic/kibana/pull/199888","mergeCommit":{"message":"[Lens]
rewrite BucketNestingEditor tests to use react testing library
(#199888)\n\n## Summary\r\n\r\nHi! This PR rewrites the
`BucketNestingEditor` tests to use the react\r\ntesting
library.\r\n\r\nFixes #199839 \r\n\r\n<img width=\"1063\"
alt=\"Screenshot 2024-11-12 at 3 35
06 PM\"\r\nsrc=\"https://github.com/user-attachments/assets/95036fe0-46e8-4bf2-9d77-31d225d38ed1\">\r\n\r\n###
Checklist\r\n\r\n- [n/a] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n\r\n---------\r\n\r\nCo-authored-by:
Marta Bondyra
<[email protected]>","sha":"eddfe5b8a73ac636d5e75606280bd771a01b1adb"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199888","number":199888,"mergeCommit":{"message":"[Lens]
rewrite BucketNestingEditor tests to use react testing library
(#199888)\n\n## Summary\r\n\r\nHi! This PR rewrites the
`BucketNestingEditor` tests to use the react\r\ntesting
library.\r\n\r\nFixes #199839 \r\n\r\n<img width=\"1063\"
alt=\"Screenshot 2024-11-12 at 3 35
06 PM\"\r\nsrc=\"https://github.com/user-attachments/assets/95036fe0-46e8-4bf2-9d77-31d225d38ed1\">\r\n\r\n###
Checklist\r\n\r\n- [n/a] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n\r\n---------\r\n\r\nCo-authored-by:
Marta Bondyra
<[email protected]>","sha":"eddfe5b8a73ac636d5e75606280bd771a01b1adb"}}]}]
BACKPORT-->

Co-authored-by: Kyra Cho <[email protected]>
@kibanamachine kibanamachine added v8.17.0 and removed backport missing Added to PRs automatically when the are determined to be missing a backport. labels Nov 26, 2024
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 12, 2024
…elastic#199888)

## Summary

Hi! This PR rewrites the `BucketNestingEditor` tests to use the react
testing library.

Fixes elastic#199839 

<img width="1063" alt="Screenshot 2024-11-12 at 3 35 06 PM"
src="https://github.com/user-attachments/assets/95036fe0-46e8-4bf2-9d77-31d225d38ed1">

### Checklist

- [n/a] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

---------

Co-authored-by: Marta Bondyra <[email protected]>
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 💝community release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.17.0 v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Lens] rewrite BucketNestingEditor tests to react testing library
4 participants