From 0322704ca2d438737417bc5eace21c61aa784c8e Mon Sep 17 00:00:00 2001 From: Garrett Spong Date: Mon, 22 Jan 2024 15:00:14 -0700 Subject: [PATCH] [Security Solution] Reduces noise in tests by mocking additional QueryClient functions (#175266) ## Summary After https://github.com/elastic/kibana/pull/174317, some of our Security Solution tests got quite noisy with the following errors:

This PR adds additional mocks to the SecuritySolution `QueryClient` to quiet the noise. Note, there was no underlying issue here, I had just missed adding these new mocks to the main SecuritySolution QueryClient (they were added to the [other one](https://github.com/elastic/kibana/pull/174317/files#diff-f6898b396527248e4f5b8fcb0a87d917e9787ca3956dbae9afbfdc093b977e57R42-R47) within detections). ## Testing To test, run one of the offending tests locally and ensure you don't see the above errors, e.g. from kibana root: ```bash node scripts/jest.js --runTestsByPath x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/coverage_overview_dashboard.test.tsx ```

### Checklist Delete any items that are not applicable to this PR. - [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 --- .../security_solution/public/common/mock/test_providers.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/x-pack/plugins/security_solution/public/common/mock/test_providers.tsx b/x-pack/plugins/security_solution/public/common/mock/test_providers.tsx index 3dbb9636cb739bf..3e98c9ce346f2bf 100644 --- a/x-pack/plugins/security_solution/public/common/mock/test_providers.tsx +++ b/x-pack/plugins/security_solution/public/common/mock/test_providers.tsx @@ -70,6 +70,11 @@ export const TestProvidersComponent: React.FC = ({ retry: false, }, }, + logger: { + log: jest.fn(), + warn: jest.fn(), + error: () => {}, + }, }); return (