From 00698cc9b31e6a7606727893096cb9154051c4aa Mon Sep 17 00:00:00 2001 From: kishor82 Date: Sun, 3 Sep 2023 21:34:38 +0530 Subject: [PATCH] fix: Add 'http' property to serviceContextMock and update test expectations Signed-off-by: kishor82 --- .../use_send_current_request_to_opensearch.test.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/console/public/application/hooks/use_send_current_request_to_opensearch/use_send_current_request_to_opensearch.test.tsx b/src/plugins/console/public/application/hooks/use_send_current_request_to_opensearch/use_send_current_request_to_opensearch.test.tsx index cc7be7e444f0..8955972d27a0 100644 --- a/src/plugins/console/public/application/hooks/use_send_current_request_to_opensearch/use_send_current_request_to_opensearch.test.tsx +++ b/src/plugins/console/public/application/hooks/use_send_current_request_to_opensearch/use_send_current_request_to_opensearch.test.tsx @@ -74,7 +74,10 @@ describe('useSendCurrentRequestToOpenSearch', () => { const { result } = renderHook(() => useSendCurrentRequestToOpenSearch(), { wrapper: contexts }); await act(() => result.current()); - expect(sendRequestToOpenSearch).toHaveBeenCalledWith({ requests: ['test'] }); + expect(sendRequestToOpenSearch).toHaveBeenCalledWith({ + requests: ['test'], + http: mockContextValue.services.http, + }); // Second call should be the request success const [, [requestSucceededCall]] = (dispatch as jest.Mock).mock.calls;