-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Upgrade @testing-library/user-event
to latest ^14.5.2
#189949
Upgrade @testing-library/user-event
to latest ^14.5.2
#189949
Conversation
9f4594f
to
d1c0eba
Compare
a54e9da
to
4b804a0
Compare
@testing-library/user-event
to ^14.4.3
@testing-library/user-event
to ^14.5.2
@testing-library/user-event
to ^14.5.2
@testing-library/user-event
to latest ^14.5.2
## Summary During `yarn kbn bootstrap` we get the following message: > @testing-library/[email protected]" has unmet peer dependency "@testing-library/dom@>=7.21.4". This PR adds `@testing-library/dom` version `8.19.0` to `package.json` to match the version used by `@testing-library/react`. Future versions of `@testing-library/react` switched to requiring this dependency to be a peer dependency too. This PR is in preparation for #189949. ### Checklist - [x] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
0e27a30
to
f3973e7
Compare
…_rule_editor/slo_selector
@paul-tavares Thanks for the feedback, I addressed your individual comments. I don't think there's a way around not passing |
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.
Thanks @walterra for the follow up updates.
Approving on behave of the security-defend-workflows
team 👍
x-pack/plugins/security_solution/public/management/components/console/mocks.tsx
Show resolved
Hide resolved
// so this uses fireEvent instead for the time being. | ||
// See here for a related discussion: https://github.com/testing-library/user-event/discussions/1164 | ||
// await user.keyboard('[Enter]'); | ||
fireEvent.keyDown(keyCaptureInput, { key: 'enter', keyCode: 13 }); |
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.
awesome. Thank you
@@ -42,7 +42,7 @@ describe('When using the Endpoint Details Actions Menu', () => { | |||
let coreStart: AppContextTestRender['coreStart']; | |||
let renderResult: ReturnType<AppContextTestRender['render']>; | |||
let httpMocks: ReturnType<typeof endpointPageHttpMock>; | |||
let middlewareSpy: AppContextTestRender['middlewareSpy']; | |||
// let middlewareSpy: AppContextTestRender['middlewareSpy']; |
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.
Hmmm. if the tests are passing, then maybe we no longer need it.
Its been a long time, but I seem to remember creating this middleware "spy" to ensure that we did not do test assertion too soon (before the middleware was able to do what it needed to do). It address test flakiness mostly.
I'll note this in the internal issue I created so we can revisit... but maybe we no longer need it.
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.
elastic/security-generative-ai
changes LGTM:
elastic/security-generative-ai
- x-pack/packages/kbn-elastic-assistant/impl/assistant/context_pills/index.test.tsx
- x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/selected_prompt_contexts/index.test.tsx
- x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/index.test.tsx
- x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/select_system_prompt/index.test.tsx
- x-pack/packages/kbn-elastic-assistant/impl/data_anonymization_editor/context_editor/bulk_actions/index.test.tsx
- x-pack/packages/kbn-elastic-assistant/impl/data_anonymization_editor/context_editor/index.test.tsx
- x-pack/packages/kbn-elastic-assistant/impl/data_anonymization_editor/stats/allowed_stat/index.test.tsx
- x-pack/packages/kbn-elastic-assistant/impl/data_anonymization_editor/stats/anonymized_stat/index.test.tsx
- x-pack/packages/kbn-elastic-assistant/impl/data_anonymization_editor/stats/available_stat/index.test.tsx
- x-pack/packages/kbn-elastic-assistant/impl/new_chat/index.test.tsx
- x-pack/packages/kbn-elastic-assistant/impl/new_chat_by_title/index.test.tsx
- x-pack/plugins/security_solution/public/assistant/update_query_in_form/index.test.tsx
- x-pack/plugins/security_solution/public/attack_discovery/tour/video_toast.test.tsx
- x-pack/plugins/stack_connectors/public/connector_types/bedrock/connector.test.tsx
- x-pack/plugins/stack_connectors/public/connector_types/gemini/connector.test.tsx
- x-pack/plugins/stack_connectors/public/connector_types/openai/connector.test.tsx
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.
Entity Analytics changes LGTM!
Hey @elastic/security-service-integrations @elastic/security-threat-hunting-investigations teams, would be great to get some code owner's reviews on this one please 👋 |
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @walterra |
## Summary This test (#180931) was introduced right before the version bump of user-events (#189949). This PR updates the one async call to be awaited, hopefully fixing the test. Solves: #192475 Unskipped tests are passing now: https://buildkite.com/elastic/kibana-pull-request/builds/233177 --------- Co-authored-by: Antonio <[email protected]>
## Summary This PR attempts to fix tests skipped in /issues/193092 and /issues/193554. The tests seem to be flaky right after an [upgrade to `user-event`](#189949) dependency on Sep 10th. ### 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 - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed
## Summary This PR attempts to fix tests skipped in elastic/issues/193092 and elastic/issues/193554. The tests seem to be flaky right after an [upgrade to `user-event`](elastic#189949) dependency on Sep 10th. ### 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 - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed (cherry picked from commit e70b533)
…#197380) # Backport This will backport the following commits from `main` to `8.x`: - [[SecuritySolution][Endpoint] Re-enabled skipped tests (#197220)](#197220) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Ash","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-23T08:33:37Z","message":"[SecuritySolution][Endpoint] Re-enabled skipped tests (#197220)\n\n## Summary\r\n\r\nThis PR attempts to fix tests skipped in /issues/193092\r\nand /issues/193554.\r\nThe tests seem to be flaky right after an [upgrade to\r\n`user-event`](#189949) dependency\r\non Sep 10th.\r\n\r\n### Checklist\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed","sha":"e70b533bdb443a4ebc8229237583160eeeaad412","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Defend Workflows","backport:version","v8.17.0"],"title":"[SecuritySolution][Endpoint] Re-enabled skipped tests","number":197220,"url":"https://github.com/elastic/kibana/pull/197220","mergeCommit":{"message":"[SecuritySolution][Endpoint] Re-enabled skipped tests (#197220)\n\n## Summary\r\n\r\nThis PR attempts to fix tests skipped in /issues/193092\r\nand /issues/193554.\r\nThe tests seem to be flaky right after an [upgrade to\r\n`user-event`](#189949) dependency\r\non Sep 10th.\r\n\r\n### Checklist\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed","sha":"e70b533bdb443a4ebc8229237583160eeeaad412"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197220","number":197220,"mergeCommit":{"message":"[SecuritySolution][Endpoint] Re-enabled skipped tests (#197220)\n\n## Summary\r\n\r\nThis PR attempts to fix tests skipped in /issues/193092\r\nand /issues/193554.\r\nThe tests seem to be flaky right after an [upgrade to\r\n`user-event`](#189949) dependency\r\non Sep 10th.\r\n\r\n### Checklist\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed","sha":"e70b533bdb443a4ebc8229237583160eeeaad412"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Ash <[email protected]>
Summary
Upgrades
@testing-library/user-event
to^14.5.2
. See the release notes forv14
for breaking changes: https://github.com/testing-library/user-event/releases/tag/v14.0.0I was facing an issue with
v13.5.0
withuserEvent.click()
in a PR (#189729) and was able to verify thatv14.4.3
onwards fixes it so I decided to update that package. What a rabbit hole 😅 !user-event
v14
events return a promise, so this PR updates usage of the likes ofuserEvent.click
withawait userEvent.click
. Regex to search foruserEvent
calls that missawait
except.setup
:(?<!await\s)userEvent\.(?!setup\b)
, undefined, { skipPointerEventsCheck: true });
to, { pointerEventsCheck: 0 });
.List of files where I had to skip tests (
git diff main...HEAD -G'\.skip' --name-only
):packages/kbn-dom-drag-drop
packages/kbn-dom-drag-drop/src/droppable.test.tsx
x-pack/plugins/cases
x-pack/plugins/cases/public/components/templates/form.test.tsx
x-pack/plugins/cases/public/components/user_actions/user_actions_list.test.tsx
x-pack/plugins/cloud_security_posture
x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx
x-pack/plugins/lens
x-pack/plugins/lens/public/datasources/form_based/dimension_panel/format_selector.test.tsx
x-pack/plugins/observability_solution
x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/request_body_field.test.tsx
x-pack/plugins/security_solution
x-pack/plugins/security_solution/public/management/components/console/components/command_input/integration_tests/command_input.test.tsx
x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/kill_process_action.test.tsx
x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/release_action.test.tsx
x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/status_action.test.tsx
x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/upload_action.test.tsx
x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/integration_tests/response_actions_log.test.tsx
x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/event_filters_flyout.test.tsx
x-pack/plugins/security_solution/public/management/pages/response_actions/view/response_actions_list_page.test.tsx
I plan to do a talk on Kibana Demo Days to walk through some of the breaking changes and learnings.
Checklist