[8.x] [React@18] fix When on the host isolation exceptions page should search using expected exception item fields (#208396) (#208574)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[React@18] fix When on the host isolation exceptions page should
search using expected exception item fields
(#208396)](https://github.com/elastic/kibana/pull/208396)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Anton
Dosov","email":"anton.dosov@elastic.co"},"sourceCommit":{"committedDate":"2025-01-28T16:32:02Z","message":"[React@18]
fix When on the host isolation exceptions page should search using
expected exception item fields (#208396)\n\n##
Summary\r\n\r\nfix\r\nhttps://github.com/elastic/kibana/pull/208339#issuecomment-2615621371\r\n\r\n-
[
]\r\n[[job]](0194a7ad-2ab6-40c2-a11c-685683bbb663)\r\nJest
Integration Tests / When on the host isolation exceptions page\r\nshould
search using expected exception item fields\r\n\r\n\r\nFix the test so
it passes with React@18\r\n\r\n\r\n```\r\nREACT_18=true node
scripts/jest
--config=x-pack/solutions/security/plugins/security_solution/jest.integration.config.js
/x-pack/solutions/security/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/integration_tests/host_isolation_exceptions_list.test.tsx\r\n```\r\n\r\n\r\nWe
already saw a very similar timeout failure
here:\r\nhttps://github.com/elastic/kibana/pull/207195/files#r1922454027","sha":"8f10ac2163de398e8d22a0d14a5cbe99ccc951fa","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:SharedUX","backport:prev-minor","React@18"],"title":"[React@18]
fix When on the host isolation exceptions page should search using
expected exception item
fields","number":208396,"url":"https://github.com/elastic/kibana/pull/208396","mergeCommit":{"message":"[React@18]
fix When on the host isolation exceptions page should search using
expected exception item fields (#208396)\n\n##
Summary\r\n\r\nfix\r\nhttps://github.com/elastic/kibana/pull/208339#issuecomment-2615621371\r\n\r\n-
[
]\r\n[[job]](0194a7ad-2ab6-40c2-a11c-685683bbb663)\r\nJest
Integration Tests / When on the host isolation exceptions page\r\nshould
search using expected exception item fields\r\n\r\n\r\nFix the test so
it passes with React@18\r\n\r\n\r\n```\r\nREACT_18=true node
scripts/jest
--config=x-pack/solutions/security/plugins/security_solution/jest.integration.config.js
/x-pack/solutions/security/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/integration_tests/host_isolation_exceptions_list.test.tsx\r\n```\r\n\r\n\r\nWe
already saw a very similar timeout failure
here:\r\nhttps://github.com/elastic/kibana/pull/207195/files#r1922454027","sha":"8f10ac2163de398e8d22a0d14a5cbe99ccc951fa"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/208396","number":208396,"mergeCommit":{"message":"[React@18]
fix When on the host isolation exceptions page should search using
expected exception item fields (#208396)\n\n##
Summary\r\n\r\nfix\r\nhttps://github.com/elastic/kibana/pull/208339#issuecomment-2615621371\r\n\r\n-
[
]\r\n[[job]](0194a7ad-2ab6-40c2-a11c-685683bbb663)\r\nJest
Integration Tests / When on the host isolation exceptions page\r\nshould
search using expected exception item fields\r\n\r\n\r\nFix the test so
it passes with React@18\r\n\r\n\r\n```\r\nREACT_18=true node
scripts/jest
--config=x-pack/solutions/security/plugins/security_solution/jest.integration.config.js
/x-pack/solutions/security/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/integration_tests/host_isolation_exceptions_list.test.tsx\r\n```\r\n\r\n\r\nWe
already saw a very similar timeout failure
here:\r\nhttps://github.com/elastic/kibana/pull/207195/files#r1922454027","sha":"8f10ac2163de398e8d22a0d14a5cbe99ccc951fa"}}]}]
BACKPORT-->

Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
This commit is contained in:
Kibana Machine 2025-01-29 05:06:31 +11:00 committed by GitHub
parent b48c3f9a58
commit c1c77285a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -60,10 +60,10 @@ describe('When on the host isolation exceptions page', () => {
it('should search using expected exception item fields', async () => {
const expectedFilterString = parseQueryFilterToKQL('fooFooFoo', SEARCHABLE_FIELDS);
const { renderResult, apiMocks, user } = prepareTest();
const { findAllByTestId } = renderResult;
const { getAllByTestId } = renderResult;
await waitFor(async () => {
expect(await findAllByTestId(`${pageTestId}-card`)).toHaveLength(10);
await waitFor(() => {
expect(getAllByTestId(`${pageTestId}-card`)).toHaveLength(10);
});
apiMocks.responseProvider.exceptionsFind.mockClear();