From 21c7e82472a97b4ee804aad9a3110ff44db710ff Mon Sep 17 00:00:00 2001 From: Eyo Okon Eyo Date: Wed, 6 Nov 2024 17:40:30 +0100 Subject: [PATCH] fix console manager test --- .../integration_tests/console_manager.test.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/console_manager/integration_tests/console_manager.test.tsx b/x-pack/plugins/security_solution/public/management/components/console/components/console_manager/integration_tests/console_manager.test.tsx index 9797005cde7d8..d9623944d8586 100644 --- a/x-pack/plugins/security_solution/public/management/components/console/components/console_manager/integration_tests/console_manager.test.tsx +++ b/x-pack/plugins/security_solution/public/management/components/console/components/console_manager/integration_tests/console_manager.test.tsx @@ -110,13 +110,19 @@ describe('When using ConsoleManager', () => { renderResult.result.current.show(consoleId); }); - expect(renderResult.result.current.getOne(consoleId)!.isVisible()).toBe(true); + let consoleLine: ReturnType; + + act(() => { + consoleLine = renderResult.result.current.getOne(consoleId); + }); + + expect(consoleLine!.isVisible()).toBe(true); act(() => { renderResult.result.current.hide(consoleId); }); - expect(renderResult.result.current.getOne(consoleId)!.isVisible()).toBe(false); + expect(consoleLine!.isVisible()).toBe(false); }); it('should throw if attempting to hide a console with invalid `id`', () => {