From 6e4f1ed4d95ed65639e1fa9ce023ffe56bd3b55a Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 26 Jul 2023 05:50:41 -0400 Subject: [PATCH] [8.9] [SecuritySolution] Add dashboard controls (#162514) (#162548) # Backport This will backport the following commits from `main` to `8.9`: - [[SecuritySolution] Add dashboard controls (#162514)](https://github.com/elastic/kibana/pull/162514) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Angela Chuang <6295984+angorayc@users.noreply.github.com> --- .../components/dashboard_renderer.test.tsx | 35 +++++++++++++++---- .../components/dashboard_renderer.tsx | 1 + 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/x-pack/plugins/security_solution/public/dashboards/components/dashboard_renderer.test.tsx b/x-pack/plugins/security_solution/public/dashboards/components/dashboard_renderer.test.tsx index 9498a0f12713c..c01f07fa36653 100644 --- a/x-pack/plugins/security_solution/public/dashboards/components/dashboard_renderer.test.tsx +++ b/x-pack/plugins/security_solution/public/dashboards/components/dashboard_renderer.test.tsx @@ -6,6 +6,9 @@ */ import { render } from '@testing-library/react'; import React from 'react'; +import { ViewMode } from '@kbn/embeddable-plugin/public'; +import { DashboardRenderer as DashboardContainerRenderer } from '@kbn/dashboard-plugin/public'; + import { TestProviders } from '../../common/mock'; import { DashboardRenderer } from './dashboard_renderer'; @@ -13,9 +16,7 @@ jest.mock('@kbn/dashboard-plugin/public', () => { const actual = jest.requireActual('@kbn/dashboard-plugin/public'); return { ...actual, - DashboardRenderer: jest - .fn() - .mockImplementation(() =>
), + DashboardRenderer: jest.fn().mockReturnValue(), }; }); @@ -40,19 +41,41 @@ describe('DashboardRenderer', () => { }, }; + beforeEach(() => { + jest.clearAllMocks(); + }); + it('renders', () => { const { queryByTestId } = render(