-
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
[React@18] Run jest tests #206411
base: main
Are you sure you want to change the base?
[React@18] Run jest tests #206411
Conversation
🤖 Jobs for this PR can be triggered through checkboxes. 🚧
ℹ️ To trigger the CI, please tick the checkbox below 👇
|
...ility/plugins/infra/public/components/asset_details/tabs/dashboards/actions/actions.test.tsx
Outdated
Show resolved
Hide resolved
/ci |
@@ -589,8 +589,14 @@ describe(' Filter Group Component ', () => { | |||
/> | |||
); | |||
|
|||
expect(consoleErrorSpy.mock.calls.length).toBe(1); | |||
expect(String(consoleErrorSpy.mock.calls[0][0])).toMatch(URL_PARAM_ARRAY_EXCEPTION_MSG); | |||
const componentErrors = consoleErrorSpy.mock.calls.filter( |
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.
@@ -110,14 +110,14 @@ describe('<FilterByAssigneesPopover />', () => { | |||
const onUsersChangeMock = jest.fn(); | |||
const { getByTestId, getByText } = renderFilterByAssigneesPopover([], onUsersChangeMock); | |||
|
|||
getByTestId(FILTER_BY_ASSIGNEES_BUTTON).click(); | |||
fireEvent.click(getByTestId(FILTER_BY_ASSIGNEES_BUTTON)); |
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.
getByTestId(ASSIGNEES_ADD_BUTTON_TEST_ID).click(); | ||
getByText('User 1').click(); | ||
getByText('User 3').click(); | ||
fireEvent.click(getByTestId(ASSIGNEES_ADD_BUTTON_TEST_ID)); |
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.
x-pack/solutions/security/plugins/session_view/public/components/tty_player/hooks.ts
Outdated
Show resolved
Hide resolved
/ci |
/ci |
## Summary Extracted from #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 #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.
## 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)
## Summary Extracted remaining easy backward-compatible unit test fixes that fail with React@18 from #206411 The idea is that the tests should pass for both React@17 and React@18
## Summary Extracted remaining easy backward-compatible unit test fixes that fail with React@18 from elastic#206411 The idea is that the tests should pass for both React@17 and React@18 (cherry picked from commit 3ca02b3)
## Summary Extracted remaining easy backward-compatible unit test fixes that fail with React@18 from elastic#206411 The idea is that the tests should pass for both React@17 and React@18
## Summary Culled from #206411 This PR is informed from the work that's being done for the migration to React 18, whilst trying out kibana with react 18 we had couple of test fail relating to this particular component, details here [[job]](https://buildkite.com/elastic/kibana-pull-request/builds/266993#0194655f-1466-4ee3-80ed-54e398b09492) [[logs]](https://buildkite.com/organizations/elastic/pipelines/kibana-pull-request/builds/266993/jobs/0194655f-1466-4ee3-80ed-54e398b09492/artifacts/01946583-34ed-444a-bc55-10e684c325ef), it's worth mentioning the way the component was written causes unnecessary re-renders that doesn't actually make the interval for the tty playspeed exactly constant. The approach taken here is such that there's no need to depend on state change to cause the next line to be written, now we setup a timer interval just once for the entire duration that the tty is playing, and said timer only ever gets cleaned up on pause. P.S. This fix does not utilize any APIs from react 18 so it's backward compatible with our current version of react. ### Checklist <!-- Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials --> - [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 <!-- - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ... --> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
@elasticmachine merge upstream |
## Summary Culled from elastic#206411 This PR is informed from the work that's being done for the migration to React 18, whilst trying out kibana with react 18 we had couple of test fail relating to this particular component, details here [[job]](https://buildkite.com/elastic/kibana-pull-request/builds/266993#0194655f-1466-4ee3-80ed-54e398b09492) [[logs]](https://buildkite.com/organizations/elastic/pipelines/kibana-pull-request/builds/266993/jobs/0194655f-1466-4ee3-80ed-54e398b09492/artifacts/01946583-34ed-444a-bc55-10e684c325ef), it's worth mentioning the way the component was written causes unnecessary re-renders that doesn't actually make the interval for the tty playspeed exactly constant. The approach taken here is such that there's no need to depend on state change to cause the next line to be written, now we setup a timer interval just once for the entire duration that the tty is playing, and said timer only ever gets cleaned up on pause. P.S. This fix does not utilize any APIs from react 18 so it's backward compatible with our current version of react. ### Checklist <!-- Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials --> - [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 <!-- - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ... --> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit e7b5f3d)
## Summary Extracted remaining easy backward-compatible unit test fixes that fail with React@18 from elastic#206411 The idea is that the tests should pass for both React@17 and React@18
## Summary Culled from elastic#206411 This PR is informed from the work that's being done for the migration to React 18, whilst trying out kibana with react 18 we had couple of test fail relating to this particular component, details here [[job]](https://buildkite.com/elastic/kibana-pull-request/builds/266993#0194655f-1466-4ee3-80ed-54e398b09492) [[logs]](https://buildkite.com/organizations/elastic/pipelines/kibana-pull-request/builds/266993/jobs/0194655f-1466-4ee3-80ed-54e398b09492/artifacts/01946583-34ed-444a-bc55-10e684c325ef), it's worth mentioning the way the component was written causes unnecessary re-renders that doesn't actually make the interval for the tty playspeed exactly constant. The approach taken here is such that there's no need to depend on state change to cause the next line to be written, now we setup a timer interval just once for the entire duration that the tty is playing, and said timer only ever gets cleaned up on pause. P.S. This fix does not utilize any APIs from react 18 so it's backward compatible with our current version of react. ### Checklist <!-- Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials --> - [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 <!-- - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ... --> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
@elasticmachine merge upstream |
## 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.
## Summary Extracted remaining easy backward-compatible unit test fixes that fail with React@18 from elastic#206411 The idea is that the tests should pass for both React@17 and React@18
## Summary Culled from elastic#206411 This PR is informed from the work that's being done for the migration to React 18, whilst trying out kibana with react 18 we had couple of test fail relating to this particular component, details here [[job]](https://buildkite.com/elastic/kibana-pull-request/builds/266993#0194655f-1466-4ee3-80ed-54e398b09492) [[logs]](https://buildkite.com/organizations/elastic/pipelines/kibana-pull-request/builds/266993/jobs/0194655f-1466-4ee3-80ed-54e398b09492/artifacts/01946583-34ed-444a-bc55-10e684c325ef), it's worth mentioning the way the component was written causes unnecessary re-renders that doesn't actually make the interval for the tty playspeed exactly constant. The approach taken here is such that there's no need to depend on state change to cause the next line to be written, now we setup a timer interval just once for the entire duration that the tty is playing, and said timer only ever gets cleaned up on pause. P.S. This fix does not utilize any APIs from react 18 so it's backward compatible with our current version of react. ### Checklist <!-- Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials --> - [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 <!-- - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ... --> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
Saved Objects .kibana field count
History
|
Summary
Summarize your PR. If it involves visual changes include a screenshot or gif.
import { render } enzyme
and emotion classname snapshot serializerfireEvent.click
in place of invoking click directly on the element should resolve the issue