From 3b6c5c5b71bec30dde596ab685fe7f6bf9f22c4d Mon Sep 17 00:00:00 2001 From: Ece Ozalp Date: Thu, 25 Feb 2021 11:24:23 -0500 Subject: [PATCH] [Security Solution] Adds getMockTheme function Closes elastic/security-team#866. --- .../security_solution/public/app/app.tsx | 18 +- .../components/and_or_badge/index.test.tsx | 3 +- .../rounded_badge_antenna.test.tsx | 3 +- .../empty_value/empty_value.test.tsx | 3 +- .../add_exception_modal/index.test.tsx | 5 +- .../exceptions/builder/and_badge.test.tsx | 3 +- .../builder/exception_item.test.tsx | 5 +- .../exceptions/builder/index.test.tsx | 5 +- .../edit_exception_modal/index.test.tsx | 5 +- .../exceptions/exceptionable_fields.json | 2 +- .../exception_item/exception_details.test.tsx | 5 +- .../exception_item/exception_entries.test.tsx | 5 +- .../viewer/exception_item/index.test.tsx | 7 +- .../viewer/exceptions_utility.test.tsx | 5 +- .../viewer/exceptions_viewer_items.test.tsx | 5 +- .../exceptions/viewer/index.test.tsx | 5 +- .../common/components/inspect/modal.test.tsx | 5 +- .../components/paginated_table/index.test.tsx | 5 +- .../components/stat_items/index.test.tsx | 9 +- .../threat_match/and_badge.test.tsx | 5 +- .../components/threat_match/index.test.tsx | 5 +- .../threat_match/list_item.test.tsx | 5 +- .../common/lib/kibana/kibana_react.mock.ts | 5 + .../public/common/mock/index.ts | 6 +- .../rules/query_preview/index.test.tsx | 301 ++++++++---------- .../rules/step_about_rule/index.test.tsx | 5 +- .../step_about_rule_details/index.test.tsx | 5 +- .../rules/all/utility_bar.test.tsx | 5 +- .../trusted_apps_grid/index.test.tsx | 5 +- .../trusted_apps_list/index.test.tsx | 9 +- .../open_timeline/open_timeline.test.tsx | 5 +- .../open_timeline_modal_body.test.tsx | 5 +- .../open_timeline/search_row/index.test.tsx | 5 +- .../timelines_table/actions_columns.test.tsx | 3 +- .../timelines_table/common_columns.test.tsx | 3 +- .../timelines_table/extended_columns.test.tsx | 3 +- .../icon_header_columns.test.tsx | 3 +- .../timelines_table/index.test.tsx | 3 +- .../open_timeline/title_row/index.test.tsx | 7 +- .../unknown_column_renderer.test.tsx | 5 +- 40 files changed, 258 insertions(+), 243 deletions(-) diff --git a/x-pack/plugins/security_solution/public/app/app.tsx b/x-pack/plugins/security_solution/public/app/app.tsx index 95ab822ed50c8..451e29543fa03 100644 --- a/x-pack/plugins/security_solution/public/app/app.tsx +++ b/x-pack/plugins/security_solution/public/app/app.tsx @@ -6,15 +6,12 @@ */ import { History } from 'history'; -import React, { memo, useMemo, FC } from 'react'; +import React, { memo, FC } from 'react'; import { ApolloProvider } from 'react-apollo'; import { Store, Action } from 'redux'; import { Provider as ReduxStoreProvider } from 'react-redux'; -import { ThemeProvider } from 'styled-components'; import { EuiErrorBoundary } from '@elastic/eui'; -import euiDarkVars from '@elastic/eui/dist/eui_theme_dark.json'; -import euiLightVars from '@elastic/eui/dist/eui_theme_light.json'; import { AppLeaveHandler } from '../../../../../src/core/public'; import { ManageUserInfo } from '../detections/components/user_info'; @@ -30,6 +27,7 @@ import { ApolloClientContext } from '../common/utils/apollo_context'; import { ManageGlobalTimeline } from '../timelines/components/manage_timeline'; import { StartServices } from '../types'; import { PageRouter } from './routes'; +import { EuiThemeProvider } from '../../../../../src/plugins/kibana_react/common'; interface StartAppComponent extends AppFrontendLibs { children: React.ReactNode; @@ -46,15 +44,7 @@ const StartAppComponent: FC = ({ store, }) => { const { i18n } = useKibana().services; - const [darkMode] = useUiSetting$(DEFAULT_DARK_MODE); - const theme = useMemo( - () => ({ - eui: darkMode ? euiDarkVars : euiLightVars, - darkMode, - }), - [darkMode] - ); return ( @@ -64,7 +54,7 @@ const StartAppComponent: FC = ({ - + @@ -72,7 +62,7 @@ const StartAppComponent: FC = ({ - + diff --git a/x-pack/plugins/security_solution/public/common/components/and_or_badge/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/and_or_badge/index.test.tsx index a6dd64737f5ee..e36123ac817ec 100644 --- a/x-pack/plugins/security_solution/public/common/components/and_or_badge/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/and_or_badge/index.test.tsx @@ -10,8 +10,9 @@ import { ThemeProvider } from 'styled-components'; import { mount } from 'enzyme'; import { AndOrBadge } from './'; +import { getMockTheme } from '../../lib/kibana/kibana_react.mock'; -const mockTheme = { eui: { euiColorLightShade: '#ece' } }; +const mockTheme = getMockTheme({ eui: { euiColorLightShade: '#ece' } }); describe('AndOrBadge', () => { test('it renders top and bottom antenna bars when "includeAntennas" is true', () => { diff --git a/x-pack/plugins/security_solution/public/common/components/and_or_badge/rounded_badge_antenna.test.tsx b/x-pack/plugins/security_solution/public/common/components/and_or_badge/rounded_badge_antenna.test.tsx index c6536a05be45d..eaf4dfa3c66e8 100644 --- a/x-pack/plugins/security_solution/public/common/components/and_or_badge/rounded_badge_antenna.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/and_or_badge/rounded_badge_antenna.test.tsx @@ -10,8 +10,9 @@ import { ThemeProvider } from 'styled-components'; import { mount } from 'enzyme'; import { RoundedBadgeAntenna } from './rounded_badge_antenna'; +import { getMockTheme } from '../../lib/kibana/kibana_react.mock'; -const mockTheme = { eui: { euiColorLightShade: '#ece' } }; +const mockTheme = getMockTheme({ eui: { euiColorLightShade: '#ece' } }); describe('RoundedBadgeAntenna', () => { test('it renders top and bottom antenna bars', () => { diff --git a/x-pack/plugins/security_solution/public/common/components/empty_value/empty_value.test.tsx b/x-pack/plugins/security_solution/public/common/components/empty_value/empty_value.test.tsx index e3c74bf425628..8bf2bba491051 100644 --- a/x-pack/plugins/security_solution/public/common/components/empty_value/empty_value.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/empty_value/empty_value.test.tsx @@ -18,9 +18,10 @@ import { getEmptyValue, getOrEmptyTag, } from '.'; +import { getMockTheme } from '../../lib/kibana/kibana_react.mock'; describe('EmptyValue', () => { - const mockTheme = { eui: { euiColorMediumShade: '#ece' } }; + const mockTheme = getMockTheme({ eui: { euiColorMediumShade: '#ece' } }); test('it renders against snapshot', () => { const wrapper = shallow(

{getEmptyString()}

); diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/add_exception_modal/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/add_exception_modal/index.test.tsx index 9ba6fe104be45..456dabec06c24 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/add_exception_modal/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/add_exception_modal/index.test.tsx @@ -30,8 +30,9 @@ import { } from '../../../../../common/detection_engine/schemas/response/rules_schema.mocks'; import { useRuleAsync } from '../../../../detections/containers/detection_engine/rules/use_rule_async'; import { AlertData } from '../types'; +import { getMockTheme } from '../../../lib/kibana/kibana_react.mock'; -const mockTheme = { +const mockTheme = getMockTheme({ eui: { euiBreakpoints: { l: '1200px', @@ -40,7 +41,7 @@ const mockTheme = { m: '10px', }, }, -}; +}); jest.mock('../../../../detections/containers/detection_engine/alerts/use_signal_index'); jest.mock('../../../../common/lib/kibana'); diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/builder/and_badge.test.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/builder/and_badge.test.tsx index 5299e4e61ab21..16678e4da2a1d 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/builder/and_badge.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/builder/and_badge.test.tsx @@ -10,8 +10,9 @@ import { ThemeProvider } from 'styled-components'; import { mount } from 'enzyme'; import { BuilderAndBadgeComponent } from './and_badge'; +import { getMockTheme } from '../../../lib/kibana/kibana_react.mock'; -const mockTheme = { eui: { euiColorLightShade: '#ece' } }; +const mockTheme = getMockTheme({ eui: { euiColorLightShade: '#ece' } }); describe('BuilderAndBadgeComponent', () => { test('it renders exceptionItemEntryFirstRowAndBadge for very first exception item in builder', () => { diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/builder/exception_item.test.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/builder/exception_item.test.tsx index 1ea54473032cc..cbeb987f49b7b 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/builder/exception_item.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/builder/exception_item.test.tsx @@ -16,12 +16,13 @@ import { getEntryMatchMock } from '../../../../../../lists/common/schemas/types/ import { getEntryMatchAnyMock } from '../../../../../../lists/common/schemas/types/entry_match_any.mock'; import { BuilderExceptionListItemComponent } from './exception_item'; +import { getMockTheme } from '../../../lib/kibana/kibana_react.mock'; -const mockTheme = { +const mockTheme = getMockTheme({ eui: { euiColorLightShade: '#ece', }, -}; +}); jest.mock('../../../../common/lib/kibana'); diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/builder/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/builder/index.test.tsx index d9402272bd9a2..4d0e3306e3315 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/builder/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/builder/index.test.tsx @@ -21,12 +21,13 @@ import { useKibana } from '../../../../common/lib/kibana'; import { getEmptyValue } from '../../empty_value'; import { ExceptionBuilderComponent } from './'; +import { getMockTheme } from '../../../lib/kibana/kibana_react.mock'; -const mockTheme = { +const mockTheme = getMockTheme({ eui: { euiColorLightShade: '#ece', }, -}; +}); jest.mock('../../../../common/lib/kibana'); diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/edit_exception_modal/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/edit_exception_modal/index.test.tsx index ec44f815ae243..a30e6f769c47e 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/edit_exception_modal/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/edit_exception_modal/index.test.tsx @@ -27,8 +27,9 @@ import { getRulesSchemaMock, } from '../../../../../common/detection_engine/schemas/response/rules_schema.mocks'; import { useRuleAsync } from '../../../../detections/containers/detection_engine/rules/use_rule_async'; +import { getMockTheme } from '../../../lib/kibana/kibana_react.mock'; -const mockTheme = { +const mockTheme = getMockTheme({ eui: { euiBreakpoints: { l: '1200px', @@ -37,7 +38,7 @@ const mockTheme = { m: '10px', }, }, -}; +}); jest.mock('../../../../common/lib/kibana'); jest.mock('../../../../detections/containers/detection_engine/rules'); diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/exceptionable_fields.json b/x-pack/plugins/security_solution/public/common/components/exceptions/exceptionable_fields.json index a59e440918175..2866cbc6baf92 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/exceptionable_fields.json +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/exceptionable_fields.json @@ -129,4 +129,4 @@ "user.hash", "user.id", "Ransomware.feature" -] \ No newline at end of file +] diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/exception_details.test.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/exception_details.test.tsx index b96ae5c06dd22..b6cf55585c0d3 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/exception_details.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/exception_details.test.tsx @@ -13,12 +13,13 @@ import moment from 'moment-timezone'; import { ExceptionDetails } from './exception_details'; import { getExceptionListItemSchemaMock } from '../../../../../../../lists/common/schemas/response/exception_list_item_schema.mock'; import { getCommentsArrayMock } from '../../../../../../../lists/common/schemas/types/comment.mock'; +import { getMockTheme } from '../../../../lib/kibana/kibana_react.mock'; -const mockTheme = { +const mockTheme = getMockTheme({ eui: { euiColorLightestShade: '#ece', }, -}; +}); describe('ExceptionDetails', () => { beforeEach(() => { diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/exception_entries.test.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/exception_entries.test.tsx index d29b8930c7b3e..228de32fee7d2 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/exception_entries.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/exception_entries.test.tsx @@ -12,8 +12,11 @@ import { mount } from 'enzyme'; import { ExceptionEntries } from './exception_entries'; import { getFormattedEntryMock } from '../../exceptions.mock'; import { getEmptyValue } from '../../../empty_value'; +import { getMockTheme } from '../../../../lib/kibana/kibana_react.mock'; -const mockTheme = { eui: { euiSize: '10px', euiColorPrimary: '#ece', euiColorDanger: '#ece' } }; +const mockTheme = getMockTheme({ + eui: { euiSize: '10px', euiColorPrimary: '#ece', euiColorDanger: '#ece' }, +}); describe('ExceptionEntries', () => { test('it does NOT render the and badge if only one exception item entry exists', () => { diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/index.test.tsx index 72ce56f250b48..8b915379f48bb 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/index.test.tsx @@ -12,17 +12,18 @@ import { mount } from 'enzyme'; import { ExceptionItem } from './'; import { getExceptionListItemSchemaMock } from '../../../../../../../lists/common/schemas/response/exception_list_item_schema.mock'; import { getCommentsArrayMock } from '../../../../../../../lists/common/schemas/types/comment.mock'; +import { getMockTheme } from '../../../../lib/kibana/kibana_react.mock'; jest.mock('../../../../lib/kibana'); -const mockTheme = { +const mockTheme = getMockTheme({ eui: { euiColorDanger: '#ece', euiColorLightestShade: '#ece', euiColorPrimary: '#ece', - euiFontWeightSemiBold: 'bold', + euiFontWeightSemiBold: 1, }, -}; +}); describe('ExceptionItem', () => { it('it renders ExceptionDetails and ExceptionEntries', () => { diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_utility.test.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_utility.test.tsx index 42ce0c792dfa3..9bbd490f1ed16 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_utility.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_utility.test.tsx @@ -10,8 +10,9 @@ import { ThemeProvider } from 'styled-components'; import { mountWithIntl } from '@kbn/test/jest'; import { ExceptionsViewerUtility } from './exceptions_utility'; +import { getMockTheme } from '../../../lib/kibana/kibana_react.mock'; -const mockTheme = { +const mockTheme = getMockTheme({ eui: { euiBreakpoints: { l: '1200px', @@ -21,7 +22,7 @@ const mockTheme = { }, euiBorderThin: '1px solid #ece', }, -}; +}); describe('ExceptionsViewerUtility', () => { it('it renders correct pluralized text when more than one exception exists', () => { diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_viewer_items.test.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_viewer_items.test.tsx index 167b95995212b..1350f8c2d36bd 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_viewer_items.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_viewer_items.test.tsx @@ -12,14 +12,15 @@ import { mount } from 'enzyme'; import * as i18n from '../translations'; import { getExceptionListItemSchemaMock } from '../../../../../../lists/common/schemas/response/exception_list_item_schema.mock'; import { ExceptionsViewerItems } from './exceptions_viewer_items'; +import { getMockTheme } from '../../../lib/kibana/kibana_react.mock'; -const mockTheme = { +const mockTheme = getMockTheme({ eui: { euiSize: '10px', euiColorPrimary: '#ece', euiColorDanger: '#ece', }, -}; +}); describe('ExceptionsViewerItems', () => { it('it renders empty prompt if "showEmpty" is "true"', () => { diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/index.test.tsx index 64ecea71b120e..3fe6497105af1 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/index.test.tsx @@ -18,8 +18,9 @@ import { } from '../../../../../public/lists_plugin_deps'; import { getExceptionListSchemaMock } from '../../../../../../lists/common/schemas/response/exception_list_schema.mock'; import { getFoundExceptionListItemSchemaMock } from '../../../../../../lists/common/schemas/response/found_exception_list_item_schema.mock'; +import { getMockTheme } from '../../../lib/kibana/kibana_react.mock'; -const mockTheme = { +const mockTheme = getMockTheme({ eui: { euiColorEmptyShade: '#ece', euiBreakpoints: { @@ -29,7 +30,7 @@ const mockTheme = { m: '10px', }, }, -}; +}); jest.mock('../../../../common/lib/kibana'); jest.mock('../../../../../public/lists_plugin_deps'); diff --git a/x-pack/plugins/security_solution/public/common/components/inspect/modal.test.tsx b/x-pack/plugins/security_solution/public/common/components/inspect/modal.test.tsx index 731ff049d9b42..572513180025f 100644 --- a/x-pack/plugins/security_solution/public/common/components/inspect/modal.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/inspect/modal.test.tsx @@ -11,14 +11,15 @@ import { ThemeProvider } from 'styled-components'; import { NO_ALERT_INDEX } from '../../../../common/constants'; import { ModalInspectQuery, formatIndexPatternRequested } from './modal'; +import { getMockTheme } from '../../lib/kibana/kibana_react.mock'; -const mockTheme = { +const mockTheme = getMockTheme({ eui: { euiBreakpoints: { l: '1200px', }, }, -}; +}); const request = '{"index": ["auditbeat-*","filebeat-*","packetbeat-*","winlogbeat-*"],"allowNoIndices": true, "ignoreUnavailable": true, "body": { "aggregations": {"hosts": {"cardinality": {"field": "host.name" } }, "hosts_histogram": {"auto_date_histogram": {"field": "@timestamp","buckets": "6"},"aggs": { "count": {"cardinality": {"field": "host.name" }}}}}, "query": {"bool": {"filter": [{"range": { "@timestamp": {"gte": 1562290224506,"lte": 1562376624506 }}}]}}, "size": 0, "track_total_hits": false}}'; diff --git a/x-pack/plugins/security_solution/public/common/components/paginated_table/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/paginated_table/index.test.tsx index c20f1ae66c797..3439bb0a7ddb3 100644 --- a/x-pack/plugins/security_solution/public/common/components/paginated_table/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/paginated_table/index.test.tsx @@ -14,6 +14,7 @@ import { Direction } from '../../../graphql/types'; import { BasicTableProps, PaginatedTable } from './index'; import { getHostsColumns, mockData, rowItems, sortedHosts } from './index.mock'; import { ThemeProvider } from 'styled-components'; +import { getMockTheme } from '../../lib/kibana/kibana_react.mock'; jest.mock('react', () => { const r = jest.requireActual('react'); @@ -21,7 +22,7 @@ jest.mock('react', () => { return { ...r, memo: (x: any) => x }; }); -const mockTheme = { +const mockTheme = getMockTheme({ eui: { euiColorEmptyShade: '#ece', euiSizeL: '10px', @@ -32,7 +33,7 @@ const mockTheme = { m: '10px', }, }, -}; +}); describe('Paginated Table Component', () => { let loadPage: jest.Mock; diff --git a/x-pack/plugins/security_solution/public/common/components/stat_items/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/stat_items/index.test.tsx index 9a6e430e392a3..4c4cc1f838a50 100644 --- a/x-pack/plugins/security_solution/public/common/components/stat_items/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/stat_items/index.test.tsx @@ -31,11 +31,11 @@ import { mockNarrowDateRange, } from '../../../network/components/kpi_network/mock'; import { - mockGlobalState, apolloClientObservable, - SUB_PLUGINS_REDUCER, - kibanaObservable, createSecuritySolutionStorageMock, + kibanaObservable, + mockGlobalState, + SUB_PLUGINS_REDUCER, } from '../../mock'; import { State, createStore } from '../../store'; import { Provider as ReduxStoreProvider } from 'react-redux'; @@ -43,6 +43,7 @@ import { HostsKpiStrategyResponse, NetworkKpiStrategyResponse, } from '../../../../common/search_strategy'; +import { getMockTheme } from '../../lib/kibana/kibana_react.mock'; const from = '2019-06-15T06:00:00.000Z'; const to = '2019-06-18T06:00:00.000Z'; @@ -56,7 +57,7 @@ jest.mock('../charts/barchart', () => { }); describe('Stat Items Component', () => { - const mockTheme = { eui: { euiColorMediumShade: '#ece' } }; + const mockTheme = getMockTheme({ eui: { euiColorMediumShade: '#ece' } }); const state: State = mockGlobalState; const { storage } = createSecuritySolutionStorageMock(); const store = createStore( diff --git a/x-pack/plugins/security_solution/public/common/components/threat_match/and_badge.test.tsx b/x-pack/plugins/security_solution/public/common/components/threat_match/and_badge.test.tsx index effa8426341be..28b4e60fe48d0 100644 --- a/x-pack/plugins/security_solution/public/common/components/threat_match/and_badge.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/threat_match/and_badge.test.tsx @@ -10,12 +10,13 @@ import { ThemeProvider } from 'styled-components'; import { mount } from 'enzyme'; import { AndBadgeComponent } from './and_badge'; +import { getMockTheme } from '../../lib/kibana/kibana_react.mock'; -const mockTheme = { +const mockTheme = getMockTheme({ eui: { euiColorLightShade: '#ece', }, -}; +}); describe('AndBadgeComponent', () => { test('it renders entryItemIndexItemEntryFirstRowAndBadge for very first item', () => { diff --git a/x-pack/plugins/security_solution/public/common/components/threat_match/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/threat_match/index.test.tsx index 6aa33c3bcf4ca..058703ce369f7 100644 --- a/x-pack/plugins/security_solution/public/common/components/threat_match/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/threat_match/index.test.tsx @@ -17,12 +17,13 @@ import { useKibana } from '../../../common/lib/kibana'; import { ThreatMatchComponent } from './'; import { ThreatMapEntries } from './types'; import { IndexPattern } from 'src/plugins/data/public'; +import { getMockTheme } from '../../lib/kibana/kibana_react.mock'; -const mockTheme = { +const mockTheme = getMockTheme({ eui: { euiColorLightShade: '#ece', }, -}; +}); jest.mock('../../../common/lib/kibana'); diff --git a/x-pack/plugins/security_solution/public/common/components/threat_match/list_item.test.tsx b/x-pack/plugins/security_solution/public/common/components/threat_match/list_item.test.tsx index 8a9adf075cbc8..39fc5dee82e8c 100644 --- a/x-pack/plugins/security_solution/public/common/components/threat_match/list_item.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/threat_match/list_item.test.tsx @@ -15,12 +15,13 @@ import { fields } from '../../../../../../../src/plugins/data/common/index_patte import { ListItemComponent } from './list_item'; import { ThreatMapEntries } from './types'; import { IndexPattern } from 'src/plugins/data/public'; +import { getMockTheme } from '../../lib/kibana/kibana_react.mock'; -const mockTheme = { +const mockTheme = getMockTheme({ eui: { euiColorLightShade: '#ece', }, -}; +}); jest.mock('../../../common/lib/kibana'); diff --git a/x-pack/plugins/security_solution/public/common/lib/kibana/kibana_react.mock.ts b/x-pack/plugins/security_solution/public/common/lib/kibana/kibana_react.mock.ts index 17ab5026f757f..e504344f3d25f 100644 --- a/x-pack/plugins/security_solution/public/common/lib/kibana/kibana_react.mock.ts +++ b/x-pack/plugins/security_solution/public/common/lib/kibana/kibana_react.mock.ts @@ -9,6 +9,7 @@ import React from 'react'; +import { RecursivePartial } from '@elastic/eui/src/components/common'; import { coreMock } from '../../../../../../../src/core/public/mocks'; import { KibanaContextProvider } from '../../../../../../../src/plugins/kibana_react/public'; import { dataPluginMock } from '../../../../../../../src/plugins/data/public/mocks'; @@ -36,6 +37,7 @@ import { import { StartServices } from '../../../types'; import { createSecuritySolutionStorageMock } from '../../mock/mock_local_storage'; import { MlUrlGenerator } from '../../../../../ml/public'; +import { EuiTheme } from '../../../../../../../src/plugins/kibana_react/common'; const mockUiSettings: Record = { [DEFAULT_TIME_RANGE]: { from: 'now-15m', to: 'now', mode: 'quick' }, @@ -148,3 +150,6 @@ export const createKibanaContextProviderMock = () => { return ({ children }: { children: React.ReactNode }) => React.createElement(KibanaContextProvider, { services }, children); }; + +export const getMockTheme = (partialTheme: RecursivePartial): EuiTheme => + partialTheme as EuiTheme; diff --git a/x-pack/plugins/security_solution/public/common/mock/index.ts b/x-pack/plugins/security_solution/public/common/mock/index.ts index a29b34ef4a1e5..469c3d9101eb4 100644 --- a/x-pack/plugins/security_solution/public/common/mock/index.ts +++ b/x-pack/plugins/security_solution/public/common/mock/index.ts @@ -9,11 +9,11 @@ export * from './global_state'; export * from './header'; export * from './hook_wrapper'; export * from './index_pattern'; -export * from './mock_timeline_data'; export * from './mock_detail_item'; +export * from './mock_ecs'; export * from './mock_local_storage'; +export * from './mock_timeline_data'; export * from './netflow'; export * from './test_providers'; -export * from './utils'; -export * from './mock_ecs'; export * from './timeline_results'; +export * from './utils'; diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/query_preview/index.test.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/query_preview/index.test.tsx index 4d43040880ae1..3de3d3f6cbc29 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/query_preview/index.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/query_preview/index.test.tsx @@ -16,12 +16,13 @@ import { PreviewQuery } from './'; import { getMockEqlResponse } from '../../../../common/hooks/eql/eql_search_response.mock'; import { useMatrixHistogram } from '../../../../common/containers/matrix_histogram'; import { useEqlPreview } from '../../../../common/hooks/eql/'; +import { getMockTheme } from '../../../../common/lib/kibana/kibana_react.mock'; -const mockTheme = { +const mockTheme = getMockTheme({ eui: { euiSuperDatePickerWidth: '180px', }, -}; +}); jest.mock('../../../../common/lib/kibana'); jest.mock('../../../../common/containers/matrix_histogram'); @@ -132,19 +133,17 @@ describe('PreviewQuery', () => { test('it renders query histogram when rule type is query and preview button clicked', () => { const wrapper = mount( - - - - - + + + ); wrapper.find('[data-test-subj="queryPreviewButton"] button').at(0).simulate('click'); @@ -159,19 +158,17 @@ describe('PreviewQuery', () => { test('it renders noise warning when rule type is query, timeframe is last hour and hit average is greater than 1/hour', async () => { const wrapper = mount( - - - - - + + + ); (useMatrixHistogram as jest.Mock).mockReturnValue([ @@ -195,19 +192,17 @@ describe('PreviewQuery', () => { test('it renders query histogram when rule type is saved_query and preview button clicked', () => { const wrapper = mount( - - - - - + + + ); wrapper.find('[data-test-subj="queryPreviewButton"] button').at(0).simulate('click'); @@ -222,19 +217,17 @@ describe('PreviewQuery', () => { test('it renders eql histogram when preview button clicked and rule type is eql', () => { const wrapper = mount( - - - - - + + + ); wrapper.find('[data-test-subj="queryPreviewButton"] button').at(0).simulate('click'); @@ -249,19 +242,17 @@ describe('PreviewQuery', () => { test('it renders noise warning when rule type is eql, timeframe is last hour and hit average is greater than 1/hour', async () => { const wrapper = mount( - - - - - + + + ); (useEqlPreview as jest.Mock).mockReturnValue([ @@ -285,26 +276,24 @@ describe('PreviewQuery', () => { test('it renders threshold histogram when preview button clicked, rule type is threshold, and threshold field is defined', () => { const wrapper = mount( - - - - - + + + ); (useMatrixHistogram as jest.Mock).mockReturnValue([ @@ -334,26 +323,24 @@ describe('PreviewQuery', () => { test('it renders noise warning when rule type is threshold, and threshold field is defined, timeframe is last hour and hit average is greater than 1/hour', async () => { const wrapper = mount( - - - - - + + + ); (useMatrixHistogram as jest.Mock).mockReturnValue([ @@ -380,26 +367,24 @@ describe('PreviewQuery', () => { test('it renders query histogram when preview button clicked, rule type is threshold, and threshold field is not defined', () => { const wrapper = mount( - - - - - + + + ); wrapper.find('[data-test-subj="queryPreviewButton"] button').at(0).simulate('click'); @@ -414,26 +399,24 @@ describe('PreviewQuery', () => { test('it renders query histogram when preview button clicked, rule type is threshold, and threshold field is empty string', () => { const wrapper = mount( - - - - - + + + ); wrapper.find('[data-test-subj="queryPreviewButton"] button').at(0).simulate('click'); @@ -448,19 +431,17 @@ describe('PreviewQuery', () => { test('it hides histogram when timeframe changes', () => { const wrapper = mount( - - - - - + + + ); wrapper.find('[data-test-subj="queryPreviewButton"] button').at(0).simulate('click'); diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/step_about_rule/index.test.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/step_about_rule/index.test.tsx index c1773b2fffbab..51c2cad069d7d 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/step_about_rule/index.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/step_about_rule/index.test.tsx @@ -22,12 +22,13 @@ import { RuleStep, } from '../../../pages/detection_engine/rules/types'; import { fillEmptySeverityMappings } from '../../../pages/detection_engine/rules/helpers'; +import { getMockTheme } from '../../../../common/lib/kibana/kibana_react.mock'; -const mockTheme = { +const mockTheme = getMockTheme({ eui: { euiColorLightestShade: '#ece', }, -}; +}); jest.mock('../../../../common/containers/source'); jest.mock('@elastic/eui', () => { diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/step_about_rule_details/index.test.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/step_about_rule_details/index.test.tsx index 52bb844d24339..5061f12c0d22f 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/step_about_rule_details/index.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/step_about_rule_details/index.test.tsx @@ -15,12 +15,13 @@ import { mockAboutStepRule } from '../../../pages/detection_engine/rules/all/__m import { HeaderSection } from '../../../../common/components/header_section'; import { StepAboutRule } from '../step_about_rule'; import { AboutStepRule } from '../../../pages/detection_engine/rules/types'; +import { getMockTheme } from '../../../../common/lib/kibana/kibana_react.mock'; jest.mock('../../../../common/lib/kibana'); -const mockTheme = { +const mockTheme = getMockTheme({ eui: { euiSizeL: '10px', euiBreakpoints: { s: '450px' }, paddingSizes: { m: '10px' } }, -}; +}); describe('StepAboutRuleToggleDetails', () => { let mockRule: AboutStepRule; diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/utility_bar.test.tsx b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/utility_bar.test.tsx index 687142cc7ed17..049a1a9b9da14 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/utility_bar.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/utility_bar.test.tsx @@ -11,8 +11,11 @@ import { ThemeProvider } from 'styled-components'; import { waitFor } from '@testing-library/react'; import { AllRulesUtilityBar } from './utility_bar'; +import { getMockTheme } from '../../../../../common/lib/kibana/kibana_react.mock'; -const mockTheme = { eui: { euiBreakpoints: { l: '1200px' }, paddingSizes: { m: '10px' } } }; +const mockTheme = getMockTheme({ + eui: { euiBreakpoints: { l: '1200px' }, paddingSizes: { m: '10px' } }, +}); describe('AllRules', () => { it('renders AllRulesUtilityBar total rules and selected rules', () => { diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_grid/index.test.tsx b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_grid/index.test.tsx index 89f4f7de68c8d..8a98903dd9983 100644 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_grid/index.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_grid/index.test.tsx @@ -21,12 +21,13 @@ import { } from '../../../test_utils'; import { TrustedAppsGrid } from '.'; +import { getMockTheme } from '../../../../../../common/lib/kibana/kibana_react.mock'; -const mockTheme = { +const mockTheme = getMockTheme({ eui: { euiSize: '16px', }, -}; +}); jest.mock('@elastic/eui/lib/services/accessibility/html_id_generator', () => ({ htmlIdGenerator: () => () => 'mockId', diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_list/index.test.tsx b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_list/index.test.tsx index eb6e99a8d585d..d054061dbba31 100644 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_list/index.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_list/index.test.tsx @@ -20,13 +20,14 @@ import { createGlobalNoMiddlewareStore, } from '../../../test_utils'; -const mockTheme = { +import { TrustedAppsList } from '.'; +import { getMockTheme } from '../../../../../../common/lib/kibana/kibana_react.mock'; + +const mockTheme = getMockTheme({ eui: { euiColorLightestShade: '#ece', }, -}; - -import { TrustedAppsList } from '.'; +}); jest.mock('@elastic/eui/lib/services/accessibility/html_id_generator', () => ({ htmlIdGenerator: () => () => 'mockId', diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/open_timeline.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/open_timeline.test.tsx index 0cf7f2891dfbf..a215f02863123 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/open_timeline.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/open_timeline.test.tsx @@ -19,6 +19,7 @@ import { mockTimelineResults } from '../../../common/mock/timeline_results'; import { OpenTimeline } from './open_timeline'; import { DEFAULT_SORT_DIRECTION, DEFAULT_SORT_FIELD } from './constants'; import { TimelineType, TimelineStatus } from '../../../../common/types/timeline'; +import { getMockTheme } from '../../../common/lib/kibana/kibana_react.mock'; jest.mock('../../../common/lib/kibana'); @@ -31,7 +32,7 @@ jest.mock('react-router-dom', () => { }; }); -const mockTheme = { +const mockTheme = getMockTheme({ eui: { euiSizeL: '10px', paddingSizes: { @@ -41,7 +42,7 @@ const mockTheme = { l: '1200px', }, }, -}; +}); describe('OpenTimeline', () => { const title = 'All Timelines / Open Timelines'; diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/open_timeline_modal/open_timeline_modal_body.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/open_timeline_modal/open_timeline_modal_body.test.tsx index 38186d35d2d2d..794cd275528e4 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/open_timeline_modal/open_timeline_modal_body.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/open_timeline_modal/open_timeline_modal_body.test.tsx @@ -18,18 +18,19 @@ import { mockTimelineResults } from '../../../../common/mock/timeline_results'; import { OpenTimelineModalBody } from './open_timeline_modal_body'; import { DEFAULT_SORT_DIRECTION, DEFAULT_SORT_FIELD } from '../constants'; import { TimelineType, TimelineStatus } from '../../../../../common/types/timeline'; +import { getMockTheme } from '../../../../common/lib/kibana/kibana_react.mock'; jest.mock('../../../../common/lib/kibana'); describe('OpenTimelineModal', () => { - const mockTheme = { + const mockTheme = getMockTheme({ eui: { euiColorMediumShade: '#ece', euiBreakpoints: { s: '500px', }, }, - }; + }); const title = 'All Timelines / Open Timelines'; let mockResults: OpenTimelineResult[]; diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/search_row/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/search_row/index.test.tsx index d75823b771681..1c650b0ae0a11 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/search_row/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/search_row/index.test.tsx @@ -15,12 +15,13 @@ import { TimelineType } from '../../../../../common/types/timeline'; import { SearchRow } from '.'; import * as i18n from '../translations'; +import { getMockTheme } from '../../../../common/lib/kibana/kibana_react.mock'; -const mockTheme = { +const mockTheme = getMockTheme({ eui: { euiSizeL: '10px', }, -}; +}); describe('SearchRow', () => { test('it renders a search input with the expected placeholder when the query is empty', () => { diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/actions_columns.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/actions_columns.test.tsx index 5f0c000094960..2a77f872117f6 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/actions_columns.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/actions_columns.test.tsx @@ -17,8 +17,9 @@ import { mockTimelineResults } from '../../../../common/mock/timeline_results'; import { OpenTimelineResult } from '../types'; import { TimelinesTableProps } from '.'; import { getMockTimelinesTableProps } from './mocks'; +import { getMockTheme } from '../../../../common/lib/kibana/kibana_react.mock'; -const mockTheme = { eui: { euiColorMediumShade: '#ece' } }; +const mockTheme = getMockTheme({ eui: { euiColorMediumShade: '#ece' } }); jest.mock('../../../../common/lib/kibana'); diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/common_columns.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/common_columns.test.tsx index 3c70cc70a66de..1826413110f1e 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/common_columns.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/common_columns.test.tsx @@ -21,8 +21,9 @@ import { TimelinesTable, TimelinesTableProps } from '.'; import * as i18n from '../translations'; import { getMockTimelinesTableProps } from './mocks'; +import { getMockTheme } from '../../../../common/lib/kibana/kibana_react.mock'; -const mockTheme = { eui: { euiColorMediumShade: '#ece' } }; +const mockTheme = getMockTheme({ eui: { euiColorMediumShade: '#ece' } }); jest.mock('../../../../common/lib/kibana'); diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/extended_columns.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/extended_columns.test.tsx index 83e21267bce28..e8960d2e0ad93 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/extended_columns.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/extended_columns.test.tsx @@ -19,8 +19,9 @@ import { TimelinesTable, TimelinesTableProps } from '.'; import * as i18n from '../translations'; import { getMockTimelinesTableProps } from './mocks'; +import { getMockTheme } from '../../../../common/lib/kibana/kibana_react.mock'; -const mockTheme = { eui: { euiColorMediumShade: '#ece' } }; +const mockTheme = getMockTheme({ eui: { euiColorMediumShade: '#ece' } }); jest.mock('../../../../common/lib/kibana'); diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/icon_header_columns.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/icon_header_columns.test.tsx index a8ed5f02fa3ef..a92d3a4eac4b0 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/icon_header_columns.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/icon_header_columns.test.tsx @@ -15,8 +15,9 @@ import { mockTimelineResults } from '../../../../common/mock/timeline_results'; import { TimelinesTable, TimelinesTableProps } from '.'; import { OpenTimelineResult } from '../types'; import { getMockTimelinesTableProps } from './mocks'; +import { getMockTheme } from '../../../../common/lib/kibana/kibana_react.mock'; -const mockTheme = { eui: { euiColorMediumShade: '#ece' } }; +const mockTheme = getMockTheme({ eui: { euiColorMediumShade: '#ece' } }); jest.mock('../../../../common/lib/kibana'); diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/index.test.tsx index 01a855524ac0d..c1aecd4a33825 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/index.test.tsx @@ -17,8 +17,9 @@ import { TimelinesTable, TimelinesTableProps } from '.'; import { getMockTimelinesTableProps } from './mocks'; import * as i18n from '../translations'; +import { getMockTheme } from '../../../../common/lib/kibana/kibana_react.mock'; -const mockTheme = { eui: { euiColorMediumShade: '#ece' } }; +const mockTheme = getMockTheme({ eui: { euiColorMediumShade: '#ece' } }); jest.mock('../../../../common/lib/kibana'); diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/title_row/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/title_row/index.test.tsx index 4661f72901eb6..a94777d0e573b 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/title_row/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/title_row/index.test.tsx @@ -11,10 +11,11 @@ import React from 'react'; import { ThemeProvider } from 'styled-components'; import { TitleRow } from '.'; +import { getMockTheme } from '../../../../common/lib/kibana/kibana_react.mock'; -const mockTheme = { - eui: { euiSizeS: '10px', euiLineHeight: '20px', euiBreakpoints: { s: '10px' }, euiSize: '10px' }, -}; +const mockTheme = getMockTheme({ + eui: { euiSizeS: '10px', euiLineHeight: 10, euiBreakpoints: { s: '10px' }, euiSize: '10px' }, +}); describe('TitleRow', () => { const title = 'All Timelines / Open Timelines'; diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/unknown_column_renderer.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/unknown_column_renderer.test.tsx index 6d7a9e5aecfd9..d3c5da72cd2ad 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/unknown_column_renderer.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/unknown_column_renderer.test.tsx @@ -15,12 +15,13 @@ import { defaultHeaders, mockTimelineData } from '../../../../../common/mock'; import { getEmptyValue } from '../../../../../common/components/empty_value'; import { unknownColumnRenderer } from './unknown_column_renderer'; import { getValues } from './helpers'; +import { getMockTheme } from '../../../../../common/lib/kibana/kibana_react.mock'; -const mockTheme = { +const mockTheme = getMockTheme({ eui: { euiColorMediumShade: '#ece', }, -}; +}); describe('unknown_column_renderer', () => { let mockDatum: TimelineNonEcsData[];