From 865c3b759effc67f5b18885d748b393a42de81c8 Mon Sep 17 00:00:00 2001 From: Alex Szabo Date: Wed, 11 Sep 2024 08:11:15 +0200 Subject: [PATCH] fix failing unit test (#192488) ## Summary This test (https://github.com/elastic/kibana/pull/180931) was introduced right before the version bump of user-events (https://github.com/elastic/kibana/pull/189949). This PR updates the one async call to be awaited, hopefully fixing the test. Solves: https://github.com/elastic/kibana/issues/192475 Unskipped tests are passing now: https://buildkite.com/elastic/kibana-pull-request/builds/233177 --------- Co-authored-by: Antonio --- .../components/connectors/thehive/case_fields.test.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/cases/public/components/connectors/thehive/case_fields.test.tsx b/x-pack/plugins/cases/public/components/connectors/thehive/case_fields.test.tsx index 2b3ce432365ed7..c4234412a3579d 100644 --- a/x-pack/plugins/cases/public/components/connectors/thehive/case_fields.test.tsx +++ b/x-pack/plugins/cases/public/components/connectors/thehive/case_fields.test.tsx @@ -15,8 +15,7 @@ import type { AppMockRenderer } from '../../../common/mock'; import { createAppMockRenderer } from '../../../common/mock'; import { TheHiveTLP } from './types'; -// Failing: See https://github.com/elastic/kibana/issues/192475 -describe.skip('TheHive Cases Fields', () => { +describe('TheHive Cases Fields', () => { const fields = { TLP: 1, }; @@ -45,7 +44,7 @@ describe.skip('TheHive Cases Fields', () => { ); - userEvent.selectOptions(screen.getByTestId('tlp-field'), '4'); + await userEvent.selectOptions(await screen.findByTestId('tlp-field'), '4'); expect(await screen.findByTestId('tlp-field')).toHaveValue(TheHiveTLP.RED.toString()); }); });