From 8eb000d62926ba57ade48523bebfbc69f373bacd Mon Sep 17 00:00:00 2001 From: patrykkopycinski Date: Wed, 8 Jan 2020 09:28:38 +0100 Subject: [PATCH] [SIEM] Cleanup unnecessary use of enzyme-to-json (#53980) --- .../siem/public/components/arrows/index.test.tsx | 3 +-- .../components/autocomplete_field/index.test.tsx | 3 +-- .../utility_bar/utility_bar.test.tsx | 3 +-- .../utility_bar/utility_bar_action.test.tsx | 3 +-- .../utility_bar/utility_bar_group.test.tsx | 3 +-- .../utility_bar/utility_bar_section.test.tsx | 3 +-- .../utility_bar/utility_bar_text.test.tsx | 3 +-- .../drag_drop_context_wrapper.test.tsx | 3 +-- .../drag_and_drop/draggable_wrapper.test.tsx | 3 +-- .../drag_and_drop/droppable_wrapper.test.tsx | 3 +-- .../public/components/draggables/index.test.tsx | 5 ++--- .../components/embeddables/embeddable.test.tsx | 3 +-- .../embeddables/embeddable_header.test.tsx | 3 +-- .../components/embeddables/embedded_map.test.tsx | 3 +-- .../index_patterns_missing_prompt.test.tsx | 3 +-- .../map_tool_tip/line_tool_tip_content.test.tsx | 3 +-- .../map_tool_tip/map_tool_tip.test.tsx | 5 ++--- .../map_tool_tip/point_tool_tip_content.test.tsx | 3 +-- .../map_tool_tip/tooltip_footer.test.tsx | 3 +-- .../public/components/empty_page/index.test.tsx | 3 +-- .../components/empty_value/empty_value.test.tsx | 3 +-- .../error_toast_dispatcher/index.test.tsx | 3 +-- .../event_details/event_details.test.tsx | 3 +-- .../components/event_details/json_view.test.tsx | 3 +-- .../field_renderers/field_renderers.test.tsx | 15 +++++++-------- .../filters_global/filters_global.test.tsx | 3 +-- .../flow_controls/flow_direction_select.test.tsx | 3 +-- .../flow_controls/flow_target_select.test.tsx | 3 +-- .../siem/public/components/flyout/index.test.tsx | 3 +-- .../public/components/flyout/pane/index.test.tsx | 3 +-- .../components/formatted_bytes/index.test.tsx | 3 +-- .../components/formatted_date/index.test.tsx | 3 +-- .../components/header_global/index.test.tsx | 3 +-- .../public/components/header_page/index.test.tsx | 3 +-- .../components/header_section/index.test.tsx | 3 +-- .../siem/public/components/ip/index.test.tsx | 3 +-- .../public/components/link_icon/index.test.tsx | 3 +-- .../siem/public/components/loader/index.test.tsx | 3 +-- .../public/components/markdown/index.test.tsx | 5 ++--- .../components/markdown/markdown_hint.test.tsx | 3 +-- .../components/ml/entity_draggable.test.tsx | 3 +-- .../ml/influencers/create_influencers.test.tsx | 3 +-- .../components/ml/score/anomaly_score.test.tsx | 3 +-- .../components/ml/score/anomaly_scores.test.tsx | 3 +-- .../ml/score/create_descriptions_list.test.tsx | 3 +-- .../components/ml/score/draggable_score.test.tsx | 5 ++--- .../filters/groups_filter_popover.test.tsx | 3 +-- .../filters/jobs_table_filters.test.tsx | 3 +-- .../ml_popover/jobs_table/job_switch.test.tsx | 3 +-- .../ml_popover/jobs_table/jobs_table.test.tsx | 3 +-- .../ml_popover/jobs_table/showing_count.test.tsx | 3 +-- .../ml_popover/popover_description.test.tsx | 3 +-- .../ml_popover/upgrade_contents.test.tsx | 3 +-- .../siem/public/components/netflow/index.test.tsx | 3 +-- .../components/notes/add_note/index.test.tsx | 3 +-- .../components/notes/add_note/new_note.test.tsx | 3 +-- .../notes/note_card/note_card_body.test.tsx | 3 +-- .../index.test.tsx | 3 +-- .../histogram_signals/index.test.tsx | 3 +-- .../hosts/authentications_table/index.test.tsx | 3 +-- .../page/hosts/host_overview/index.test.tsx | 3 +-- .../page/hosts/hosts_table/index.test.tsx | 3 +-- .../page/hosts/kpi_hosts/index.test.tsx | 7 +++---- .../hosts/uncommon_process_table/index.test.tsx | 3 +-- .../page/network/ip_overview/index.test.tsx | 3 +-- .../page/network/kpi_network/index.test.tsx | 5 ++--- .../page/network/network_dns_table/index.test.tsx | 3 +-- .../network_dns_table/is_ptr_included.test.tsx | 3 +-- .../network/network_http_table/index.test.tsx | 3 +-- .../network_top_countries_table/index.test.tsx | 5 ++--- .../network_top_n_flow_table/index.test.tsx | 5 ++--- .../page/network/tls_table/index.test.tsx | 3 +-- .../page/network/users_table/index.test.tsx | 3 +-- .../overview/overview_host_stats/index.test.tsx | 3 +-- .../overview_network_stats/index.test.tsx | 3 +-- .../components/paginated_table/index.test.tsx | 3 +-- .../siem/public/components/port/index.test.tsx | 3 +-- .../components/progress_inline/index.test.tsx | 3 +-- .../components/resize_handle/index.test.tsx | 3 +-- .../components/selectable_text/index.test.tsx | 3 +-- .../public/components/skeleton_row/index.test.tsx | 3 +-- .../components/source_destination/index.test.tsx | 3 +-- .../public/components/stat_items/index.test.tsx | 5 ++--- .../public/components/subtitle/index.test.tsx | 3 +-- .../public/components/tables/helpers.test.tsx | 9 ++++----- .../body/column_headers/filter/index.test.tsx | 3 +-- .../body/column_headers/header/index.test.tsx | 3 +-- .../header_tooltip_content/index.test.tsx | 3 +-- .../timeline/body/column_headers/index.test.tsx | 3 +-- .../column_headers/text_filter/index.test.tsx | 3 +-- .../body/data_driven_columns/index.test.tsx | 3 +-- .../timeline/body/renderers/args.test.tsx | 3 +-- .../renderers/auditd/generic_details.test.tsx | 3 +-- .../auditd/generic_file_details.test.tsx | 3 +-- .../auditd/generic_row_renderer.test.tsx | 5 ++--- .../auditd/primary_secondary_user_info.test.tsx | 3 +-- .../auditd/session_user_host_working_dir.test.tsx | 3 +-- .../body/renderers/empty_column_renderer.test.tsx | 3 +-- .../body/renderers/formatted_field.test.tsx | 3 +-- .../body/renderers/get_column_renderer.test.tsx | 3 +-- .../body/renderers/get_row_renderer.test.tsx | 3 +-- .../body/renderers/host_working_dir.test.tsx | 3 +-- .../netflow/netflow_row_renderer.test.tsx | 3 +-- .../body/renderers/plain_column_renderer.test.tsx | 3 +-- .../body/renderers/plain_row_renderer.test.tsx | 3 +-- .../body/renderers/process_draggable.test.tsx | 3 +-- .../renderers/suricata/suricata_details.test.tsx | 3 +-- .../suricata/suricata_row_renderer.test.tsx | 3 +-- .../suricata/suricata_signature.test.tsx | 3 +-- .../body/renderers/system/auth_ssh.test.tsx | 3 +-- .../renderers/system/generic_details.test.tsx | 3 +-- .../system/generic_file_details.test.tsx | 3 +-- .../system/generic_row_renderer.test.tsx | 5 ++--- .../body/renderers/system/package.test.tsx | 3 +-- .../renderers/unknown_column_renderer.test.tsx | 3 +-- .../body/renderers/user_host_working_dir.test.tsx | 3 +-- .../body/renderers/zeek/zeek_details.test.tsx | 3 +-- .../renderers/zeek/zeek_row_renderer.test.tsx | 3 +-- .../body/renderers/zeek/zeek_signature.test.tsx | 3 +-- .../timeline/body/sort/sort_indicator.test.tsx | 3 +-- .../data_providers/data_providers.test.tsx | 3 +-- .../timeline/data_providers/empty.test.tsx | 3 +-- .../timeline/data_providers/provider.test.tsx | 3 +-- .../timeline/data_providers/providers.test.tsx | 3 +-- .../components/timeline/footer/index.test.tsx | 3 +-- .../components/timeline/header/index.test.tsx | 3 +-- .../public/components/timeline/timeline.test.tsx | 3 +-- .../components/toasters/modal_all_errors.test.tsx | 3 +-- .../components/truncatable_text/index.test.tsx | 3 +-- .../public/components/wrapper_page/index.test.tsx | 9 ++++----- .../components/import_rule_modal/index.test.tsx | 3 +-- .../components/json_downloader/index.test.tsx | 3 +-- .../rules/components/rule_switch/index.test.tsx | 3 +-- .../pages/network/ip_details/index.test.tsx | 3 +-- 134 files changed, 158 insertions(+), 292 deletions(-) diff --git a/x-pack/legacy/plugins/siem/public/components/arrows/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/arrows/index.test.tsx index 141365911a7c6..5404a1ac43844 100644 --- a/x-pack/legacy/plugins/siem/public/components/arrows/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/arrows/index.test.tsx @@ -5,7 +5,6 @@ */ import { mount } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { TestProviders } from '../../mock'; @@ -20,7 +19,7 @@ describe('arrows', () => { ); - expect(toJson(wrapper.find('ArrowBody'))).toMatchSnapshot(); + expect(wrapper.find('ArrowBody')).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/autocomplete_field/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/autocomplete_field/index.test.tsx index 26e6f6d4f56b4..27e87d25e286f 100644 --- a/x-pack/legacy/plugins/siem/public/components/autocomplete_field/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/autocomplete_field/index.test.tsx @@ -7,7 +7,6 @@ import { EuiFieldSearch } from '@elastic/eui'; import euiDarkVars from '@elastic/eui/dist/eui_theme_dark.json'; import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import { noop } from 'lodash/fp'; import React from 'react'; import { ThemeProvider } from 'styled-components'; @@ -117,7 +116,7 @@ describe('Autocomplete', () => { value={''} /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it is rendering with placeholder', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/detection_engine/utility_bar/utility_bar.test.tsx b/x-pack/legacy/plugins/siem/public/components/detection_engine/utility_bar/utility_bar.test.tsx index a5eac381f9215..eae0fc4ff422b 100644 --- a/x-pack/legacy/plugins/siem/public/components/detection_engine/utility_bar/utility_bar.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/detection_engine/utility_bar/utility_bar.test.tsx @@ -6,7 +6,6 @@ import euiDarkVars from '@elastic/eui/dist/eui_theme_dark.json'; import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { TestProviders } from '../../../mock'; @@ -44,7 +43,7 @@ describe('UtilityBar', () => { ); - expect(toJson(wrapper.find('UtilityBar'))).toMatchSnapshot(); + expect(wrapper.find('UtilityBar')).toMatchSnapshot(); }); test('it applies border styles when border is true', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/detection_engine/utility_bar/utility_bar_action.test.tsx b/x-pack/legacy/plugins/siem/public/components/detection_engine/utility_bar/utility_bar_action.test.tsx index 2610fb44532f5..2a8a71955a986 100644 --- a/x-pack/legacy/plugins/siem/public/components/detection_engine/utility_bar/utility_bar_action.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/detection_engine/utility_bar/utility_bar_action.test.tsx @@ -5,7 +5,6 @@ */ import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { TestProviders } from '../../../mock'; @@ -19,7 +18,7 @@ describe('UtilityBarAction', () => { ); - expect(toJson(wrapper.find('UtilityBarAction'))).toMatchSnapshot(); + expect(wrapper.find('UtilityBarAction')).toMatchSnapshot(); }); test('it renders a popover', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/detection_engine/utility_bar/utility_bar_group.test.tsx b/x-pack/legacy/plugins/siem/public/components/detection_engine/utility_bar/utility_bar_group.test.tsx index 59ef7021d4049..e18e7d5e0b524 100644 --- a/x-pack/legacy/plugins/siem/public/components/detection_engine/utility_bar/utility_bar_group.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/detection_engine/utility_bar/utility_bar_group.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { TestProviders } from '../../../mock'; @@ -21,6 +20,6 @@ describe('UtilityBarGroup', () => { ); - expect(toJson(wrapper.find('UtilityBarGroup'))).toMatchSnapshot(); + expect(wrapper.find('UtilityBarGroup')).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/detection_engine/utility_bar/utility_bar_section.test.tsx b/x-pack/legacy/plugins/siem/public/components/detection_engine/utility_bar/utility_bar_section.test.tsx index baa4331ced8f8..f849fa4b4ee46 100644 --- a/x-pack/legacy/plugins/siem/public/components/detection_engine/utility_bar/utility_bar_section.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/detection_engine/utility_bar/utility_bar_section.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { TestProviders } from '../../../mock'; @@ -23,6 +22,6 @@ describe('UtilityBarSection', () => { ); - expect(toJson(wrapper.find('UtilityBarSection'))).toMatchSnapshot(); + expect(wrapper.find('UtilityBarSection')).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/detection_engine/utility_bar/utility_bar_text.test.tsx b/x-pack/legacy/plugins/siem/public/components/detection_engine/utility_bar/utility_bar_text.test.tsx index 794f207fd88e3..230dd80b1a86b 100644 --- a/x-pack/legacy/plugins/siem/public/components/detection_engine/utility_bar/utility_bar_text.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/detection_engine/utility_bar/utility_bar_text.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { TestProviders } from '../../../mock'; @@ -19,6 +18,6 @@ describe('UtilityBarText', () => { ); - expect(toJson(wrapper.find('UtilityBarText'))).toMatchSnapshot(); + expect(wrapper.find('UtilityBarText')).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/drag_and_drop/drag_drop_context_wrapper.test.tsx b/x-pack/legacy/plugins/siem/public/components/drag_and_drop/drag_drop_context_wrapper.test.tsx index f7aa8d4fe50b4..9e8bde8d9ff92 100644 --- a/x-pack/legacy/plugins/siem/public/components/drag_and_drop/drag_drop_context_wrapper.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/drag_and_drop/drag_drop_context_wrapper.test.tsx @@ -5,7 +5,6 @@ */ import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { MockedProvider } from 'react-apollo/test-utils'; @@ -28,7 +27,7 @@ describe('DragDropContextWrapper', () => { ); - expect(toJson(wrapper.find('DragDropContextWrapper'))).toMatchSnapshot(); + expect(wrapper.find('DragDropContextWrapper')).toMatchSnapshot(); }); test('it renders the children', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/drag_and_drop/draggable_wrapper.test.tsx b/x-pack/legacy/plugins/siem/public/components/drag_and_drop/draggable_wrapper.test.tsx index 1174a58bb165e..e846c923c5cbe 100644 --- a/x-pack/legacy/plugins/siem/public/components/drag_and_drop/draggable_wrapper.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/drag_and_drop/draggable_wrapper.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { MockedProvider } from 'react-apollo/test-utils'; @@ -33,7 +32,7 @@ describe('DraggableWrapper', () => { ); - expect(toJson(wrapper.find('DraggableWrapper'))).toMatchSnapshot(); + expect(wrapper.find('DraggableWrapper')).toMatchSnapshot(); }); test('it renders the children passed to the render prop', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/drag_and_drop/droppable_wrapper.test.tsx b/x-pack/legacy/plugins/siem/public/components/drag_and_drop/droppable_wrapper.test.tsx index 1ba49d7b57023..bd2f01721290f 100644 --- a/x-pack/legacy/plugins/siem/public/components/drag_and_drop/droppable_wrapper.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/drag_and_drop/droppable_wrapper.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { MockedProvider } from 'react-apollo/test-utils'; @@ -33,7 +32,7 @@ describe('DroppableWrapper', () => { ); - expect(toJson(wrapper.find('DroppableWrapper'))).toMatchSnapshot(); + expect(wrapper.find('DroppableWrapper')).toMatchSnapshot(); }); test('it renders the children when a render prop is not provided', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/draggables/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/draggables/index.test.tsx index 6793c3f8cbaca..76335e3c72306 100644 --- a/x-pack/legacy/plugins/siem/public/components/draggables/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/draggables/index.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { TestProviders } from '../../mock'; @@ -34,7 +33,7 @@ describe('draggables', () => { {'A child of this'} ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders the default Badge', () => { @@ -50,7 +49,7 @@ describe('draggables', () => { {'A child of this'} ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/embeddables/embeddable.test.tsx b/x-pack/legacy/plugins/siem/public/components/embeddables/embeddable.test.tsx index 884d5bc348d6f..2dc3d8828675f 100644 --- a/x-pack/legacy/plugins/siem/public/components/embeddables/embeddable.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/embeddables/embeddable.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { Embeddable } from './embeddable'; @@ -18,6 +17,6 @@ describe('Embeddable', () => { ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/embeddables/embeddable_header.test.tsx b/x-pack/legacy/plugins/siem/public/components/embeddables/embeddable_header.test.tsx index aa247b69eb4eb..3b8e137618ab0 100644 --- a/x-pack/legacy/plugins/siem/public/components/embeddables/embeddable_header.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/embeddables/embeddable_header.test.tsx @@ -5,7 +5,6 @@ */ import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { TestProviders } from '../../mock'; @@ -15,7 +14,7 @@ describe('EmbeddableHeader', () => { test('it renders', () => { const wrapper = shallow(); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders the title', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map.test.tsx b/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map.test.tsx index 897ee57b14c60..c752273777d2f 100644 --- a/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { useIndexPatterns } from '../../hooks/use_index_patterns'; @@ -41,6 +40,6 @@ describe('EmbeddedMapComponent', () => { startDate={new Date('2019-08-28T05:50:47.877Z').getTime()} /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/embeddables/index_patterns_missing_prompt.test.tsx b/x-pack/legacy/plugins/siem/public/components/embeddables/index_patterns_missing_prompt.test.tsx index 30d260709fdcd..4f617644a1fe1 100644 --- a/x-pack/legacy/plugins/siem/public/components/embeddables/index_patterns_missing_prompt.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/embeddables/index_patterns_missing_prompt.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { IndexPatternsMissingPromptComponent } from './index_patterns_missing_prompt'; @@ -15,6 +14,6 @@ jest.mock('../../lib/kibana'); describe('IndexPatternsMissingPrompt', () => { test('renders correctly against snapshot', () => { const wrapper = shallow(); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/embeddables/map_tool_tip/line_tool_tip_content.test.tsx b/x-pack/legacy/plugins/siem/public/components/embeddables/map_tool_tip/line_tool_tip_content.test.tsx index 7113904738a2c..824c717427763 100644 --- a/x-pack/legacy/plugins/siem/public/components/embeddables/map_tool_tip/line_tool_tip_content.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/embeddables/map_tool_tip/line_tool_tip_content.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { LineToolTipContentComponent } from './line_tool_tip_content'; import { FeatureProperty } from '../types'; @@ -27,6 +26,6 @@ describe('LineToolTipContent', () => { const wrapper = shallow( ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/embeddables/map_tool_tip/map_tool_tip.test.tsx b/x-pack/legacy/plugins/siem/public/components/embeddables/map_tool_tip/map_tool_tip.test.tsx index 8657b7a35f3b5..2daaeb53e45f2 100644 --- a/x-pack/legacy/plugins/siem/public/components/embeddables/map_tool_tip/map_tool_tip.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/embeddables/map_tool_tip/map_tool_tip.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { MapToolTipComponent } from './map_tool_tip'; import { MapFeature } from '../types'; @@ -19,7 +18,7 @@ jest.mock('../../search_bar', () => ({ describe('MapToolTip', () => { test('placeholder component renders correctly against snapshot', () => { const wrapper = shallow(); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('full component renders correctly against snapshot', () => { @@ -46,6 +45,6 @@ describe('MapToolTip', () => { loadFeatureGeometry={loadFeatureGeometry} /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/embeddables/map_tool_tip/point_tool_tip_content.test.tsx b/x-pack/legacy/plugins/siem/public/components/embeddables/map_tool_tip/point_tool_tip_content.test.tsx index 94884add0bbd2..8741cfaa26ca6 100644 --- a/x-pack/legacy/plugins/siem/public/components/embeddables/map_tool_tip/point_tool_tip_content.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/embeddables/map_tool_tip/point_tool_tip_content.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { FeatureProperty } from '../types'; import { getRenderedFieldValue, PointToolTipContentComponent } from './point_tool_tip_content'; @@ -49,7 +48,7 @@ describe('PointToolTipContent', () => { /> ); - expect(toJson(wrapper.find('PointToolTipContentComponent'))).toMatchSnapshot(); + expect(wrapper.find('PointToolTipContentComponent')).toMatchSnapshot(); }); test('renders array filter correctly', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/embeddables/map_tool_tip/tooltip_footer.test.tsx b/x-pack/legacy/plugins/siem/public/components/embeddables/map_tool_tip/tooltip_footer.test.tsx index e63577e5a6327..7351ea0a183c3 100644 --- a/x-pack/legacy/plugins/siem/public/components/embeddables/map_tool_tip/tooltip_footer.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/embeddables/map_tool_tip/tooltip_footer.test.tsx @@ -5,7 +5,6 @@ */ import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { ToolTipFooterComponent } from './tooltip_footer'; @@ -27,7 +26,7 @@ describe('ToolTipFilter', () => { totalFeatures={100} /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); describe('Lower bounds', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/empty_page/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/empty_page/index.test.tsx index 67b0c5ea64b51..6a14c12cee0f8 100644 --- a/x-pack/legacy/plugins/siem/public/components/empty_page/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/empty_page/index.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { EmptyPage } from './index'; @@ -18,5 +17,5 @@ test('renders correctly', () => { title="My Super Title" /> ); - expect(toJson(EmptyComponent)).toMatchSnapshot(); + expect(EmptyComponent).toMatchSnapshot(); }); diff --git a/x-pack/legacy/plugins/siem/public/components/empty_value/empty_value.test.tsx b/x-pack/legacy/plugins/siem/public/components/empty_value/empty_value.test.tsx index bd056c04acc89..fc1d30907ab09 100644 --- a/x-pack/legacy/plugins/siem/public/components/empty_value/empty_value.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/empty_value/empty_value.test.tsx @@ -6,7 +6,6 @@ import euiDarkVars from '@elastic/eui/dist/eui_theme_dark.json'; import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { ThemeProvider } from 'styled-components'; import { mountWithIntl } from 'test_utils/enzyme_helpers'; @@ -25,7 +24,7 @@ describe('EmptyValue', () => { test('it renders against snapshot', () => { const wrapper = shallow(

{getEmptyString()}

); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); describe('#getEmptyValue', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/error_toast_dispatcher/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/error_toast_dispatcher/index.test.tsx index 3ae4613214949..6b90d9ccd08c4 100644 --- a/x-pack/legacy/plugins/siem/public/components/error_toast_dispatcher/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/error_toast_dispatcher/index.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { Provider } from 'react-redux'; @@ -30,7 +29,7 @@ describe('Error Toast Dispatcher', () => { ); - expect(toJson(wrapper.find('Connect(ErrorToastDispatcherComponent)'))).toMatchSnapshot(); + expect(wrapper.find('Connect(ErrorToastDispatcherComponent)')).toMatchSnapshot(); }); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/event_details/event_details.test.tsx b/x-pack/legacy/plugins/siem/public/components/event_details/event_details.test.tsx index 7498a3e02269d..162fc8fd8bb34 100644 --- a/x-pack/legacy/plugins/siem/public/components/event_details/event_details.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/event_details/event_details.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { mockDetailItemData, mockDetailItemDataId } from '../../mock/mock_detail_item'; @@ -34,7 +33,7 @@ describe('EventDetails', () => { toggleColumn={jest.fn()} /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/event_details/json_view.test.tsx b/x-pack/legacy/plugins/siem/public/components/event_details/json_view.test.tsx index 32662b51ea3db..0cf158c8ea90b 100644 --- a/x-pack/legacy/plugins/siem/public/components/event_details/json_view.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/event_details/json_view.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { mockDetailItemData } from '../../mock'; @@ -16,7 +15,7 @@ describe('JSON View', () => { describe('rendering', () => { test('should match snapshot', () => { const wrapper = shallow(); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/field_renderers/field_renderers.test.tsx b/x-pack/legacy/plugins/siem/public/components/field_renderers/field_renderers.test.tsx index bd31f5314762e..88d03d8db6761 100644 --- a/x-pack/legacy/plugins/siem/public/components/field_renderers/field_renderers.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/field_renderers/field_renderers.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { FlowTarget, GetIpOverviewQuery, HostEcsFields } from '../../graphql/types'; @@ -37,7 +36,7 @@ describe('Field Renderers', () => { locationRenderer(['source.geo.city_name', 'source.geo.region_name'], mockData.complete) ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders emptyTagValue when no fields provided', () => { @@ -61,7 +60,7 @@ describe('Field Renderers', () => { test('it renders correctly against snapshot', () => { const wrapper = shallow(dateRenderer(mockData.complete.source!.firstSeen)); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders emptyTagValue when invalid field provided', () => { @@ -79,7 +78,7 @@ describe('Field Renderers', () => { autonomousSystemRenderer(mockData.complete.source!.autonomousSystem!, FlowTarget.source) ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders emptyTagValue when non-string field provided', () => { @@ -111,7 +110,7 @@ describe('Field Renderers', () => { test('it renders correctly against snapshot', () => { const wrapper = shallow(hostNameRenderer(mockData.complete.host, '10.10.10.10')); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders emptyTagValue when non-matching IP is provided', () => { @@ -154,7 +153,7 @@ describe('Field Renderers', () => { test('it renders correctly against snapshot', () => { const wrapper = shallow(hostNameRenderer(mockData.complete.host, '10.10.10.10')); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders emptyTagValue when non-matching IP is provided', () => { @@ -188,7 +187,7 @@ describe('Field Renderers', () => { test('it renders correctly against snapshot', () => { const wrapper = shallow(whoisRenderer('10.10.10.10')); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); }); @@ -196,7 +195,7 @@ describe('Field Renderers', () => { test('it renders correctly against snapshot', () => { const wrapper = shallow({reputationRenderer('10.10.10.10')}); - expect(toJson(wrapper.find('DragDropContext'))).toMatchSnapshot(); + expect(wrapper.find('DragDropContext')).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/filters_global/filters_global.test.tsx b/x-pack/legacy/plugins/siem/public/components/filters_global/filters_global.test.tsx index 7f377a57c3e9b..ffac0496e9f1a 100644 --- a/x-pack/legacy/plugins/siem/public/components/filters_global/filters_global.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/filters_global/filters_global.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import '../../mock/match_media'; @@ -19,6 +18,6 @@ describe('rendering', () => { ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/flow_controls/flow_direction_select.test.tsx b/x-pack/legacy/plugins/siem/public/components/flow_controls/flow_direction_select.test.tsx index 2fce177735968..f984b534c188d 100644 --- a/x-pack/legacy/plugins/siem/public/components/flow_controls/flow_direction_select.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/flow_controls/flow_direction_select.test.tsx @@ -5,7 +5,6 @@ */ import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { FlowDirection } from '../../graphql/types'; @@ -25,7 +24,7 @@ describe('Select Flow Direction', () => { /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/flow_controls/flow_target_select.test.tsx b/x-pack/legacy/plugins/siem/public/components/flow_controls/flow_target_select.test.tsx index ba05a3961619e..373cc3cdc4a92 100644 --- a/x-pack/legacy/plugins/siem/public/components/flow_controls/flow_target_select.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/flow_controls/flow_target_select.test.tsx @@ -5,7 +5,6 @@ */ import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import { clone } from 'lodash/fp'; import React from 'react'; import { ActionCreator } from 'typescript-fsa'; @@ -31,7 +30,7 @@ describe('FlowTargetSelect Component', () => { test('it renders the FlowTargetSelect', () => { const wrapper = shallow(); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/flyout/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/flyout/index.test.tsx index 3894a64f3e084..83b842956e10e 100644 --- a/x-pack/legacy/plugins/siem/public/components/flyout/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/flyout/index.test.tsx @@ -5,7 +5,6 @@ */ import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import { set } from 'lodash/fp'; import React from 'react'; import { ActionCreator } from 'typescript-fsa'; @@ -35,7 +34,7 @@ describe('Flyout', () => { /> ); - expect(toJson(wrapper.find('Flyout'))).toMatchSnapshot(); + expect(wrapper.find('Flyout')).toMatchSnapshot(); }); test('it renders the default flyout state as a button', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/flyout/pane/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/flyout/pane/index.test.tsx index d94c5f4d0a4f2..c1c890c586576 100644 --- a/x-pack/legacy/plugins/siem/public/components/flyout/pane/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/flyout/pane/index.test.tsx @@ -5,7 +5,6 @@ */ import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { TestProviders } from '../../../mock'; @@ -32,7 +31,7 @@ describe('Pane', () => { ); - expect(toJson(EmptyComponent.find('Pane'))).toMatchSnapshot(); + expect(EmptyComponent.find('Pane')).toMatchSnapshot(); }); test('it should NOT let the flyout expand to take up the full width of the element that contains it', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/formatted_bytes/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/formatted_bytes/index.test.tsx index 4412159114444..914d233bccc1f 100644 --- a/x-pack/legacy/plugins/siem/public/components/formatted_bytes/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/formatted_bytes/index.test.tsx @@ -5,7 +5,6 @@ */ import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { useUiSetting$ } from '../../lib/kibana'; @@ -23,7 +22,7 @@ describe('PreferenceFormattedBytes', () => { mockUseUiSetting$.mockImplementation(() => [DEFAULT_BYTES_FORMAT_VALUE]); const wrapper = shallow(); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders bytes to Numeral formatting when no format setting exists', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/formatted_date/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/formatted_date/index.test.tsx index 1b6f63f944882..0d8222ce85e1b 100644 --- a/x-pack/legacy/plugins/siem/public/components/formatted_date/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/formatted_date/index.test.tsx @@ -5,7 +5,6 @@ */ import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { useDateFormat, useTimeZone } from '../../hooks'; @@ -34,7 +33,7 @@ describe('formatted_date', () => { mockUseDateFormat.mockImplementation(() => ''); const wrapper = mount(); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders the date with the default configuration', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/header_global/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/header_global/index.test.tsx index a45bed87829bf..098de39bbfef5 100644 --- a/x-pack/legacy/plugins/siem/public/components/header_global/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/header_global/index.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import '../../mock/match_media'; @@ -23,6 +22,6 @@ describe('HeaderGlobal', () => { test('it renders', () => { const wrapper = shallow(); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/header_page/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/header_page/index.test.tsx index 633ff90524de6..83a70fd90d82b 100644 --- a/x-pack/legacy/plugins/siem/public/components/header_page/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/header_page/index.test.tsx @@ -6,7 +6,6 @@ import euiDarkVars from '@elastic/eui/dist/eui_theme_dark.json'; import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { TestProviders } from '../../mock'; @@ -29,7 +28,7 @@ describe('HeaderPage', () => { ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders the title', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/header_section/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/header_section/index.test.tsx index fbd8642c01fac..2bc80be20e42d 100644 --- a/x-pack/legacy/plugins/siem/public/components/header_section/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/header_section/index.test.tsx @@ -6,7 +6,6 @@ import euiDarkVars from '@elastic/eui/dist/eui_theme_dark.json'; import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { TestProviders } from '../../mock'; @@ -16,7 +15,7 @@ describe('HeaderSection', () => { test('it renders', () => { const wrapper = shallow(); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders the title', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/ip/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/ip/index.test.tsx index c042c3590c53f..cac372a27180e 100644 --- a/x-pack/legacy/plugins/siem/public/components/ip/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/ip/index.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { TestProviders } from '../../mock/test_providers'; @@ -20,7 +19,7 @@ describe('Port', () => { const wrapper = shallow( ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders the the ip address', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/link_icon/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/link_icon/index.test.tsx index 87761a51a431f..59f2acba4121b 100644 --- a/x-pack/legacy/plugins/siem/public/components/link_icon/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/link_icon/index.test.tsx @@ -5,7 +5,6 @@ */ import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { TestProviders } from '../../mock'; @@ -19,7 +18,7 @@ describe('LinkIcon', () => { ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders an action button when onClick is provided', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/loader/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/loader/index.test.tsx index 1c97e766345aa..48dd91922583f 100644 --- a/x-pack/legacy/plugins/siem/public/components/loader/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/loader/index.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { Loader } from './index'; @@ -17,6 +16,6 @@ describe('rendering', () => { {'Loading'} ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/markdown/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/markdown/index.test.tsx index 9e97ce5613009..de662c162fc0a 100644 --- a/x-pack/legacy/plugins/siem/public/components/markdown/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/markdown/index.test.tsx @@ -4,7 +4,6 @@ * you may not use this file except in compliance with the Elastic License. */ import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { Markdown } from '.'; @@ -98,7 +97,7 @@ describe('Markdown', () => { test('it renders the expected table content', () => { const wrapper = shallow(); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); }); @@ -152,7 +151,7 @@ describe('Markdown', () => { test('it renders the expected content containing a link', () => { const wrapper = shallow(); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/markdown/markdown_hint.test.tsx b/x-pack/legacy/plugins/siem/public/components/markdown/markdown_hint.test.tsx index 81aa2d586a83b..59aae5abce5c4 100644 --- a/x-pack/legacy/plugins/siem/public/components/markdown/markdown_hint.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/markdown/markdown_hint.test.tsx @@ -5,7 +5,6 @@ */ import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { MarkdownHintComponent } from './markdown_hint'; @@ -89,7 +88,7 @@ describe('MarkdownHintComponent ', () => { test('it renders the expected hints', () => { const wrapper = shallow(); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/ml/entity_draggable.test.tsx b/x-pack/legacy/plugins/siem/public/components/ml/entity_draggable.test.tsx index 562e3c15675a7..c48a5590b49cf 100644 --- a/x-pack/legacy/plugins/siem/public/components/ml/entity_draggable.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/ml/entity_draggable.test.tsx @@ -5,7 +5,6 @@ */ import React from 'react'; -import toJson from 'enzyme-to-json'; import { shallow } from 'enzyme'; import { EntityDraggableComponent } from './entity_draggable'; import { TestProviders } from '../../mock/test_providers'; @@ -22,7 +21,7 @@ describe('entity_draggable', () => { entityValue="entity-value" /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('renders with entity name with entity value as text', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/ml/influencers/create_influencers.test.tsx b/x-pack/legacy/plugins/siem/public/components/ml/influencers/create_influencers.test.tsx index 615e83d208dd6..d49c3008b696c 100644 --- a/x-pack/legacy/plugins/siem/public/components/ml/influencers/create_influencers.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/ml/influencers/create_influencers.test.tsx @@ -5,7 +5,6 @@ */ import React from 'react'; -import toJson from 'enzyme-to-json'; import { mockAnomalies } from '../mock'; import { cloneDeep } from 'lodash/fp'; import { shallow, mount } from 'enzyme'; @@ -20,7 +19,7 @@ describe('create_influencers', () => { test('renders correctly against snapshot', () => { const wrapper = shallow({createInfluencers(anomalies.anomalies[0].influencers)}); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it returns an empty string when influencers is undefined', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/ml/score/anomaly_score.test.tsx b/x-pack/legacy/plugins/siem/public/components/ml/score/anomaly_score.test.tsx index dcd0a55ca4bd1..9ff0081f4359f 100644 --- a/x-pack/legacy/plugins/siem/public/components/ml/score/anomaly_score.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/ml/score/anomaly_score.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import { cloneDeep } from 'lodash/fp'; import React from 'react'; import { AnomalyScoreComponent } from './anomaly_score'; @@ -36,7 +35,7 @@ describe('anomaly_scores', () => { narrowDateRange={narrowDateRange} /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('should not show a popover on initial render', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/ml/score/anomaly_scores.test.tsx b/x-pack/legacy/plugins/siem/public/components/ml/score/anomaly_scores.test.tsx index 68795dd104691..3041134f669ee 100644 --- a/x-pack/legacy/plugins/siem/public/components/ml/score/anomaly_scores.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/ml/score/anomaly_scores.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import { cloneDeep } from 'lodash/fp'; import React from 'react'; import { AnomalyScoresComponent, createJobKey } from './anomaly_scores'; @@ -36,7 +35,7 @@ describe('anomaly_scores', () => { narrowDateRange={narrowDateRange} /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('renders spinner when isLoading is true is passed', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/ml/score/create_descriptions_list.test.tsx b/x-pack/legacy/plugins/siem/public/components/ml/score/create_descriptions_list.test.tsx index 89b2c61bd4689..7c8900bf77d95 100644 --- a/x-pack/legacy/plugins/siem/public/components/ml/score/create_descriptions_list.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/ml/score/create_descriptions_list.test.tsx @@ -5,7 +5,6 @@ */ import { shallow, mount } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { mockAnomalies } from '../mock'; import { createDescriptionList } from './create_description_list'; @@ -35,7 +34,7 @@ describe('create_description_list', () => { )} /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it calls the narrow date range function on click', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/ml/score/draggable_score.test.tsx b/x-pack/legacy/plugins/siem/public/components/ml/score/draggable_score.test.tsx index 0d389ae14a825..f7759bb74c3ab 100644 --- a/x-pack/legacy/plugins/siem/public/components/ml/score/draggable_score.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/ml/score/draggable_score.test.tsx @@ -5,7 +5,6 @@ */ import React from 'react'; -import toJson from 'enzyme-to-json'; import { mockAnomalies } from '../mock'; import { cloneDeep } from 'lodash/fp'; import { shallow } from 'enzyme'; @@ -22,13 +21,13 @@ describe('draggable_score', () => { const wrapper = shallow( ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('renders correctly against snapshot when the index is not included', () => { const wrapper = shallow( ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/ml_popover/jobs_table/filters/groups_filter_popover.test.tsx b/x-pack/legacy/plugins/siem/public/components/ml_popover/jobs_table/filters/groups_filter_popover.test.tsx index 9a76c82fd3f60..a14ff789f1078 100644 --- a/x-pack/legacy/plugins/siem/public/components/ml_popover/jobs_table/filters/groups_filter_popover.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/ml_popover/jobs_table/filters/groups_filter_popover.test.tsx @@ -5,7 +5,6 @@ */ import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { GroupsFilterPopoverComponent } from './groups_filter_popover'; import { mockSiemJobs } from '../../__mocks__/api'; @@ -23,7 +22,7 @@ describe('GroupsFilterPopover', () => { const wrapper = shallow( ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('when a filter is clicked, it becomes checked ', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/ml_popover/jobs_table/filters/jobs_table_filters.test.tsx b/x-pack/legacy/plugins/siem/public/components/ml_popover/jobs_table/filters/jobs_table_filters.test.tsx index 266f844c8956e..cbee724802156 100644 --- a/x-pack/legacy/plugins/siem/public/components/ml_popover/jobs_table/filters/jobs_table_filters.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/ml_popover/jobs_table/filters/jobs_table_filters.test.tsx @@ -5,7 +5,6 @@ */ import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { JobsTableFiltersComponent } from './jobs_table_filters'; import { SiemJob } from '../../types'; @@ -23,7 +22,7 @@ describe('JobsTableFilters', () => { const wrapper = shallow( ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('when you click Elastic Jobs filter, state is updated and it is selected', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/ml_popover/jobs_table/job_switch.test.tsx b/x-pack/legacy/plugins/siem/public/components/ml_popover/jobs_table/job_switch.test.tsx index 69ea1929dc7ea..1186573e3e209 100644 --- a/x-pack/legacy/plugins/siem/public/components/ml_popover/jobs_table/job_switch.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/ml_popover/jobs_table/job_switch.test.tsx @@ -5,7 +5,6 @@ */ import { shallow, mount } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { isChecked, isFailure, isJobLoading, JobSwitchComponent } from './job_switch'; @@ -29,7 +28,7 @@ describe('JobSwitch', () => { onJobStateChange={onJobStateChangeMock} /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('should call onJobStateChange when the switch is clicked to be true/open', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/ml_popover/jobs_table/jobs_table.test.tsx b/x-pack/legacy/plugins/siem/public/components/ml_popover/jobs_table/jobs_table.test.tsx index a791ebef4773e..fa524d8ff3dbc 100644 --- a/x-pack/legacy/plugins/siem/public/components/ml_popover/jobs_table/jobs_table.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/ml_popover/jobs_table/jobs_table.test.tsx @@ -5,7 +5,6 @@ */ import { shallow, mount } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { JobsTableComponent } from './jobs_table'; import { mockSiemJobs } from '../__mocks__/api'; @@ -28,7 +27,7 @@ describe('JobsTableComponent', () => { onJobStateChange={onJobStateChangeMock} /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('should render the hyperlink which points specifically to the job id', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/ml_popover/jobs_table/showing_count.test.tsx b/x-pack/legacy/plugins/siem/public/components/ml_popover/jobs_table/showing_count.test.tsx index c2a11af5f997b..bf1802f42084e 100644 --- a/x-pack/legacy/plugins/siem/public/components/ml_popover/jobs_table/showing_count.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/ml_popover/jobs_table/showing_count.test.tsx @@ -5,13 +5,12 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { ShowingCountComponent } from './showing_count'; describe('ShowingCount', () => { test('renders correctly against snapshot', () => { const wrapper = shallow(); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/ml_popover/popover_description.test.tsx b/x-pack/legacy/plugins/siem/public/components/ml_popover/popover_description.test.tsx index 81f5bb726e082..e611a5234da5e 100644 --- a/x-pack/legacy/plugins/siem/public/components/ml_popover/popover_description.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/ml_popover/popover_description.test.tsx @@ -5,13 +5,12 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { PopoverDescriptionComponent } from './popover_description'; describe('JobsTableFilters', () => { test('renders correctly against snapshot', () => { const wrapper = shallow(); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/ml_popover/upgrade_contents.test.tsx b/x-pack/legacy/plugins/siem/public/components/ml_popover/upgrade_contents.test.tsx index b62307c17cb16..2ba08073b25b9 100644 --- a/x-pack/legacy/plugins/siem/public/components/ml_popover/upgrade_contents.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/ml_popover/upgrade_contents.test.tsx @@ -5,13 +5,12 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { UpgradeContentsComponent } from './upgrade_contents'; describe('JobsTableFilters', () => { test('renders correctly against snapshot', () => { const wrapper = shallow(); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/netflow/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/netflow/index.test.tsx index 2c0b1237138ed..ecf162ebf2739 100644 --- a/x-pack/legacy/plugins/siem/public/components/netflow/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/netflow/index.test.tsx @@ -4,7 +4,6 @@ * you may not use this file except in compliance with the Elastic License. */ -import toJson from 'enzyme-to-json'; import { get } from 'lodash/fp'; import React from 'react'; import { shallow } from 'enzyme'; @@ -123,7 +122,7 @@ describe('Netflow', () => { test('renders correctly against snapshot', () => { const wrapper = shallow(getNetflowInstance()); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders a destination label', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/notes/add_note/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/notes/add_note/index.test.tsx index 30789b042b4ad..ca6abc90d317b 100644 --- a/x-pack/legacy/plugins/siem/public/components/notes/add_note/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/notes/add_note/index.test.tsx @@ -5,7 +5,6 @@ */ import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { AddNote } from '.'; @@ -24,7 +23,7 @@ describe('AddNote', () => { updateNote={jest.fn()} /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders the Cancel button when onCancelAddNote is provided', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/notes/add_note/new_note.test.tsx b/x-pack/legacy/plugins/siem/public/components/notes/add_note/new_note.test.tsx index 9c4a32aad195b..24db5c5ec8125 100644 --- a/x-pack/legacy/plugins/siem/public/components/notes/add_note/new_note.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/notes/add_note/new_note.test.tsx @@ -5,7 +5,6 @@ */ import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import * as i18n from '../translations'; @@ -19,7 +18,7 @@ describe('NewNote', () => { const wrapper = shallow( ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders a tab labeled "Note"', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/notes/note_card/note_card_body.test.tsx b/x-pack/legacy/plugins/siem/public/components/notes/note_card/note_card_body.test.tsx index d1e08c19a1b65..46e1bab37495a 100644 --- a/x-pack/legacy/plugins/siem/public/components/notes/note_card/note_card_body.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/notes/note_card/note_card_body.test.tsx @@ -5,7 +5,6 @@ */ import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { ThemeProvider } from 'styled-components'; import euiDarkVars from '@elastic/eui/dist/eui_theme_dark.json'; @@ -24,7 +23,7 @@ describe('NoteCardBody', () => { ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders the text of the note in an h1', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/page/add_filter_to_global_search_bar/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/page/add_filter_to_global_search_bar/index.test.tsx index c7e620ded1d29..345701c97901f 100644 --- a/x-pack/legacy/plugins/siem/public/components/page/add_filter_to_global_search_bar/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/page/add_filter_to_global_search_bar/index.test.tsx @@ -5,7 +5,6 @@ */ import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { apolloClientObservable, mockGlobalState, TestProviders } from '../../../mock'; @@ -63,7 +62,7 @@ describe('AddFilterToGlobalSearchBar Component', () => { ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('Rendering tooltip', async () => { diff --git a/x-pack/legacy/plugins/siem/public/components/page/detection_engine/histogram_signals/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/page/detection_engine/histogram_signals/index.test.tsx index ad1d80a761854..5d2f3256ef509 100644 --- a/x-pack/legacy/plugins/siem/public/components/page/detection_engine/histogram_signals/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/page/detection_engine/histogram_signals/index.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { TestProviders } from '../../../../mock'; @@ -19,6 +18,6 @@ describe('HistogramSignals', () => { ); - expect(toJson(wrapper.find('HistogramSignals'))).toMatchSnapshot(); + expect(wrapper.find('HistogramSignals')).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/page/hosts/authentications_table/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/page/hosts/authentications_table/index.test.tsx index 964efbd79e404..d7c25e97b3838 100644 --- a/x-pack/legacy/plugins/siem/public/components/page/hosts/authentications_table/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/page/hosts/authentications_table/index.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import { getOr } from 'lodash/fp'; import React from 'react'; import { Provider as ReduxStoreProvider } from 'react-redux'; @@ -49,7 +48,7 @@ describe('Authentication Table Component', () => { ); - expect(toJson(wrapper.find('Connect(AuthenticationTableComponent)'))).toMatchSnapshot(); + expect(wrapper.find('Connect(AuthenticationTableComponent)')).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/page/hosts/host_overview/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/page/hosts/host_overview/index.test.tsx index 6ac551f8ed0ca..90cfe696610d9 100644 --- a/x-pack/legacy/plugins/siem/public/components/page/hosts/host_overview/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/page/hosts/host_overview/index.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { TestProviders } from '../../../../mock'; @@ -31,7 +30,7 @@ describe('Host Summary Component', () => { ); - expect(toJson(wrapper.find('HostOverview'))).toMatchSnapshot(); + expect(wrapper.find('HostOverview')).toMatchSnapshot(); }); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/page/hosts/hosts_table/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/page/hosts/hosts_table/index.test.tsx index 2981984c93e96..e561594013dea 100644 --- a/x-pack/legacy/plugins/siem/public/components/page/hosts/hosts_table/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/page/hosts/hosts_table/index.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import { getOr } from 'lodash/fp'; import React from 'react'; import { MockedProvider } from 'react-apollo/test-utils'; @@ -61,7 +60,7 @@ describe('Hosts Table', () => { ); - expect(toJson(wrapper.find('HostsTable'))).toMatchSnapshot(); + expect(wrapper.find('HostsTable')).toMatchSnapshot(); }); describe('Sorting on Table', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/page/hosts/kpi_hosts/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/page/hosts/kpi_hosts/index.test.tsx index 577ec5ff51470..dc2340d42ebd9 100644 --- a/x-pack/legacy/plugins/siem/public/components/page/hosts/kpi_hosts/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/page/hosts/kpi_hosts/index.test.tsx @@ -7,7 +7,6 @@ import { mockKpiHostsData, mockKpiHostDetailsData } from './mock'; import React from 'react'; import { shallow, ShallowWrapper } from 'enzyme'; -import toJson from 'enzyme-to-json'; import { KpiHostsComponentBase } from '.'; import * as statItems from '../../../stat_items'; import { kpiHostsMapping } from './kpi_hosts_mapping'; @@ -30,7 +29,7 @@ describe('kpiHostsComponent', () => { narrowDateRange={narrowDateRange} /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it should render KpiHostsData', () => { @@ -44,7 +43,7 @@ describe('kpiHostsComponent', () => { narrowDateRange={narrowDateRange} /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it should render KpiHostDetailsData', () => { @@ -58,7 +57,7 @@ describe('kpiHostsComponent', () => { narrowDateRange={narrowDateRange} /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/page/hosts/uncommon_process_table/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/page/hosts/uncommon_process_table/index.test.tsx index 115c4f3872573..76fc2a0c389c3 100644 --- a/x-pack/legacy/plugins/siem/public/components/page/hosts/uncommon_process_table/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/page/hosts/uncommon_process_table/index.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import { getOr } from 'lodash/fp'; import React from 'react'; @@ -45,7 +44,7 @@ describe('Uncommon Process Table Component', () => { ); - expect(toJson(wrapper.find('UncommonProcessTable'))).toMatchSnapshot(); + expect(wrapper.find('UncommonProcessTable')).toMatchSnapshot(); }); test('it has a double dash (empty value) without any hosts at all', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/page/network/ip_overview/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/page/network/ip_overview/index.test.tsx index 9407eca9732b4..3038d7f41c632 100644 --- a/x-pack/legacy/plugins/siem/public/components/page/network/ip_overview/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/page/network/ip_overview/index.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { ActionCreator } from 'typescript-fsa'; @@ -52,7 +51,7 @@ describe('IP Overview Component', () => { ); - expect(toJson(wrapper.find('IpOverview'))).toMatchSnapshot(); + expect(wrapper.find('IpOverview')).toMatchSnapshot(); }); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/page/network/kpi_network/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/page/network/kpi_network/index.test.tsx index 181d61d0aa853..48d3b25f59e4a 100644 --- a/x-pack/legacy/plugins/siem/public/components/page/network/kpi_network/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/page/network/kpi_network/index.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { Provider as ReduxStoreProvider } from 'react-redux'; @@ -42,7 +41,7 @@ describe('KpiNetwork Component', () => { ); - expect(toJson(wrapper.find('KpiNetworkComponent'))).toMatchSnapshot(); + expect(wrapper.find('KpiNetworkComponent')).toMatchSnapshot(); }); test('it renders the default widget', () => { @@ -59,7 +58,7 @@ describe('KpiNetwork Component', () => { ); - expect(toJson(wrapper.find('KpiNetworkComponent'))).toMatchSnapshot(); + expect(wrapper.find('KpiNetworkComponent')).toMatchSnapshot(); }); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/page/network/network_dns_table/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/page/network/network_dns_table/index.test.tsx index 96209635e9fce..e425057dd0f75 100644 --- a/x-pack/legacy/plugins/siem/public/components/page/network/network_dns_table/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/page/network/network_dns_table/index.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import { getOr } from 'lodash/fp'; import React from 'react'; import { MockedProvider } from 'react-apollo/test-utils'; @@ -50,7 +49,7 @@ describe('NetworkTopNFlow Table Component', () => { ); - expect(toJson(wrapper.find('Connect(NetworkDnsTableComponent)'))).toMatchSnapshot(); + expect(wrapper.find('Connect(NetworkDnsTableComponent)')).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/page/network/network_dns_table/is_ptr_included.test.tsx b/x-pack/legacy/plugins/siem/public/components/page/network/network_dns_table/is_ptr_included.test.tsx index 182d33f202e65..31a1b1667087a 100644 --- a/x-pack/legacy/plugins/siem/public/components/page/network/network_dns_table/is_ptr_included.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/page/network/network_dns_table/is_ptr_included.test.tsx @@ -5,7 +5,6 @@ */ import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { FlowDirection } from '../../../../graphql/types'; @@ -19,7 +18,7 @@ describe('NetworkTopNFlow Select direction', () => { test('it renders the basic switch to include PTR in table', () => { const wrapper = shallow(); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/page/network/network_http_table/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/page/network/network_http_table/index.test.tsx index 212a88060cc9a..6ce87728ebff7 100644 --- a/x-pack/legacy/plugins/siem/public/components/page/network/network_http_table/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/page/network/network_http_table/index.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import { getOr } from 'lodash/fp'; import React from 'react'; import { MockedProvider } from 'react-apollo/test-utils'; @@ -51,7 +50,7 @@ describe('NetworkHttp Table Component', () => { ); - expect(toJson(wrapper.find('Connect(NetworkHttpTableComponent)'))).toMatchSnapshot(); + expect(wrapper.find('Connect(NetworkHttpTableComponent)')).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/page/network/network_top_countries_table/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/page/network/network_top_countries_table/index.test.tsx index 5b359c1cb5372..764e440a5a4be 100644 --- a/x-pack/legacy/plugins/siem/public/components/page/network/network_top_countries_table/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/page/network/network_top_countries_table/index.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import { getOr } from 'lodash/fp'; import React from 'react'; import { MockedProvider } from 'react-apollo/test-utils'; @@ -59,7 +58,7 @@ describe('NetworkTopCountries Table Component', () => { ); - expect(toJson(wrapper.find('Connect(NetworkTopCountriesTableComponent)'))).toMatchSnapshot(); + expect(wrapper.find('Connect(NetworkTopCountriesTableComponent)')).toMatchSnapshot(); }); test('it renders the IP Details NetworkTopCountries table', () => { const wrapper = shallow( @@ -84,7 +83,7 @@ describe('NetworkTopCountries Table Component', () => { ); - expect(toJson(wrapper.find('Connect(NetworkTopCountriesTableComponent)'))).toMatchSnapshot(); + expect(wrapper.find('Connect(NetworkTopCountriesTableComponent)')).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/page/network/network_top_n_flow_table/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/page/network/network_top_n_flow_table/index.test.tsx index 6d53b15e3285b..24f68ef03d891 100644 --- a/x-pack/legacy/plugins/siem/public/components/page/network/network_top_n_flow_table/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/page/network/network_top_n_flow_table/index.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import { getOr } from 'lodash/fp'; import React from 'react'; import { MockedProvider } from 'react-apollo/test-utils'; @@ -59,7 +58,7 @@ describe('NetworkTopNFlow Table Component', () => { ); - expect(toJson(wrapper.find('Connect(NetworkTopNFlowTableComponent)'))).toMatchSnapshot(); + expect(wrapper.find('Connect(NetworkTopNFlowTableComponent)')).toMatchSnapshot(); }); test('it renders the default NetworkTopNFlow table on the IP Details page', () => { @@ -85,7 +84,7 @@ describe('NetworkTopNFlow Table Component', () => { ); - expect(toJson(wrapper.find('Connect(NetworkTopNFlowTableComponent)'))).toMatchSnapshot(); + expect(wrapper.find('Connect(NetworkTopNFlowTableComponent)')).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/page/network/tls_table/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/page/network/tls_table/index.test.tsx index 7abbc90353bb4..81a472f3175e5 100644 --- a/x-pack/legacy/plugins/siem/public/components/page/network/tls_table/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/page/network/tls_table/index.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import { getOr } from 'lodash/fp'; import React from 'react'; import { MockedProvider } from 'react-apollo/test-utils'; @@ -47,7 +46,7 @@ describe('Tls Table Component', () => { ); - expect(toJson(wrapper.find('Connect(TlsTableComponent)'))).toMatchSnapshot(); + expect(wrapper.find('Connect(TlsTableComponent)')).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/page/network/users_table/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/page/network/users_table/index.test.tsx index 139ccac1d3293..b23c7bd504fb7 100644 --- a/x-pack/legacy/plugins/siem/public/components/page/network/users_table/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/page/network/users_table/index.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import { getOr } from 'lodash/fp'; import React from 'react'; import { MockedProvider } from 'react-apollo/test-utils'; @@ -55,7 +54,7 @@ describe('Users Table Component', () => { ); - expect(toJson(wrapper.find('Connect(UsersTableComponent)'))).toMatchSnapshot(); + expect(wrapper.find('Connect(UsersTableComponent)')).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/page/overview/overview_host_stats/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/page/overview/overview_host_stats/index.test.tsx index 57ec07ce1f306..f99b2687d7072 100644 --- a/x-pack/legacy/plugins/siem/public/components/page/overview/overview_host_stats/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/page/overview/overview_host_stats/index.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { OverviewHostStats } from '.'; @@ -15,7 +14,7 @@ describe('Overview Host Stat Data', () => { describe('rendering', () => { test('it renders the default OverviewHostStats', () => { const wrapper = shallow(); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); }); describe('loading', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/page/overview/overview_network_stats/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/page/overview/overview_network_stats/index.test.tsx index fda0e7dc8b7ab..08093c5d38c15 100644 --- a/x-pack/legacy/plugins/siem/public/components/page/overview/overview_network_stats/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/page/overview/overview_network_stats/index.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { OverviewNetworkStats } from '.'; @@ -17,7 +16,7 @@ describe('Overview Network Stat Data', () => { const wrapper = shallow( ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); }); describe('loading', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/paginated_table/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/paginated_table/index.test.tsx index 150c728a38206..947bdee6a5cd2 100644 --- a/x-pack/legacy/plugins/siem/public/components/paginated_table/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/paginated_table/index.test.tsx @@ -5,7 +5,6 @@ */ import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { Direction } from '../../graphql/types'; @@ -58,7 +57,7 @@ describe('Paginated Table Component', () => { ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders the loading panel at the beginning ', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/port/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/port/index.test.tsx index 99cd0c158bbc4..6ab587f266a8a 100644 --- a/x-pack/legacy/plugins/siem/public/components/port/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/port/index.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { TestProviders } from '../../mock/test_providers'; @@ -20,7 +19,7 @@ describe('Port', () => { const wrapper = shallow( ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders the port', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/progress_inline/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/progress_inline/index.test.tsx index 8ecc50402cef1..e5c39b365d979 100644 --- a/x-pack/legacy/plugins/siem/public/components/progress_inline/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/progress_inline/index.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { ProgressInline } from './index'; @@ -18,6 +17,6 @@ describe('ProgressInline', () => { ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/resize_handle/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/resize_handle/index.test.tsx index 52abc9e993544..1237a6538a4c1 100644 --- a/x-pack/legacy/plugins/siem/public/components/resize_handle/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/resize_handle/index.test.tsx @@ -5,7 +5,6 @@ */ import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { TestProviders } from '../../mock/test_providers'; @@ -107,7 +106,7 @@ describe('Resizeable', () => { /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); describe('resize cursor styling', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/selectable_text/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/selectable_text/index.test.tsx index 98f3574375c24..430cffa520c00 100644 --- a/x-pack/legacy/plugins/siem/public/components/selectable_text/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/selectable_text/index.test.tsx @@ -5,7 +5,6 @@ */ import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { SelectableText } from '.'; @@ -13,7 +12,7 @@ import { SelectableText } from '.'; describe('SelectableText', () => { test('renders correctly against snapshot', () => { const wrapper = shallow({'You may select this text'}); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it applies the user-select: text style', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/skeleton_row/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/skeleton_row/index.test.tsx index de463f8e29f91..1fdcd8eee941f 100644 --- a/x-pack/legacy/plugins/siem/public/components/skeleton_row/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/skeleton_row/index.test.tsx @@ -5,7 +5,6 @@ */ import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { TestProviders } from '../../mock'; @@ -14,7 +13,7 @@ import { SkeletonRow } from './index'; describe('SkeletonRow', () => { test('it renders', () => { const wrapper = shallow(); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders the correct number of cells if cellCount is specified', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/source_destination/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/source_destination/index.test.tsx index 9282a05232ce1..3dee668d66a70 100644 --- a/x-pack/legacy/plugins/siem/public/components/source_destination/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/source_destination/index.test.tsx @@ -6,7 +6,6 @@ import numeral from '@elastic/numeral'; import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import { get } from 'lodash/fp'; import React from 'react'; @@ -101,7 +100,7 @@ describe('SourceDestination', () => { test('renders correctly against snapshot', () => { const wrapper = shallow(
{getSourceDestinationInstance()}
); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders a destination label', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/stat_items/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/stat_items/index.test.tsx index 43d845590ec75..e68cf47500555 100644 --- a/x-pack/legacy/plugins/siem/public/components/stat_items/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/stat_items/index.test.tsx @@ -8,7 +8,6 @@ import euiDarkVars from '@elastic/eui/dist/eui_theme_dark.json'; import { mount, ReactWrapper } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { ThemeProvider } from 'styled-components'; @@ -93,7 +92,7 @@ describe('Stat Items Component', () => { ], ])('disable charts', wrapper => { test('it renders the default widget', () => { - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('should render titles', () => { @@ -182,7 +181,7 @@ describe('Stat Items Component', () => { ); }); test('it renders the default widget', () => { - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('should handle multiple titles', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/subtitle/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/subtitle/index.test.tsx index 3424c05f32d63..155b219c04b92 100644 --- a/x-pack/legacy/plugins/siem/public/components/subtitle/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/subtitle/index.test.tsx @@ -5,7 +5,6 @@ */ import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { TestProviders } from '../../mock'; @@ -15,7 +14,7 @@ describe('Subtitle', () => { test('it renders', () => { const wrapper = shallow(); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders one subtitle string item', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/tables/helpers.test.tsx b/x-pack/legacy/plugins/siem/public/components/tables/helpers.test.tsx index 0b8807915732b..17c7c0bac8fa2 100644 --- a/x-pack/legacy/plugins/siem/public/components/tables/helpers.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/tables/helpers.test.tsx @@ -12,7 +12,6 @@ import { } from './helpers'; import React from 'react'; import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import { TestProviders } from '../../mock'; import { getEmptyValue } from '../empty_value'; import { useMountAppended } from '../../utils/use_mount_appended'; @@ -29,7 +28,7 @@ describe('Table Helpers', () => { idPrefix: 'idPrefix', }); const wrapper = shallow({rowItem}); - expect(toJson(wrapper.find('DraggableWrapper'))).toMatchSnapshot(); + expect(wrapper.find('DraggableWrapper')).toMatchSnapshot(); }); test('it returns empty value when rowItem is undefined', () => { @@ -97,7 +96,7 @@ describe('Table Helpers', () => { idPrefix: 'idPrefix', }); const wrapper = shallow({rowItems}); - expect(toJson(wrapper.find('DragDropContext'))).toMatchSnapshot(); + expect(wrapper.find('DragDropContext')).toMatchSnapshot(); }); test('it returns empty value when rowItems is undefined', () => { @@ -193,7 +192,7 @@ describe('Table Helpers', () => { test('it returns correctly against snapshot', () => { const rowItemOverflow = getRowItemOverflow(items, 'attrName', 1, 1); const wrapper = shallow(
{rowItemOverflow}
); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it does not show "more not shown" when maxOverflowItems are not exceeded', () => { @@ -215,7 +214,7 @@ describe('Table Helpers', () => { const wrapper = shallow( ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it does not truncates as per custom overflowLength value', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/column_headers/filter/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/column_headers/filter/index.test.tsx index 48c9c991b24b4..b9cfee395bafb 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/column_headers/filter/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/column_headers/filter/index.test.tsx @@ -5,7 +5,6 @@ */ import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { ColumnHeaderType } from '../column_header'; @@ -24,7 +23,7 @@ describe('Filter', () => { }; const wrapper = shallow(); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); describe('rendering', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/column_headers/header/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/column_headers/header/index.test.tsx index f1b412319a377..64f32674cd042 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/column_headers/header/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/column_headers/header/index.test.tsx @@ -5,7 +5,6 @@ */ import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { Direction } from '../../../../../graphql/types'; @@ -40,7 +39,7 @@ describe('Header', () => { timelineId={timelineId} /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); describe('rendering', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/column_headers/header_tooltip_content/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/column_headers/header_tooltip_content/index.test.tsx index aec0267061f55..20c139ae1d050 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/column_headers/header_tooltip_content/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/column_headers/header_tooltip_content/index.test.tsx @@ -5,7 +5,6 @@ */ import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import { cloneDeep } from 'lodash/fp'; import React from 'react'; @@ -89,6 +88,6 @@ describe('HeaderToolTipContent', () => { test('it renders the expected table content', () => { const wrapper = shallow(); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/column_headers/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/column_headers/index.test.tsx index f40c93aaba3a4..0fdd7d78ae253 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/column_headers/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/column_headers/index.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { DEFAULT_ACTIONS_COLUMN_WIDTH } from '../helpers'; @@ -54,7 +53,7 @@ describe('ColumnHeaders', () => { toggleColumn={jest.fn()} /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders the field browser', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/column_headers/text_filter/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/column_headers/text_filter/index.test.tsx index 0323629638001..4378a96b2919a 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/column_headers/text_filter/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/column_headers/text_filter/index.test.tsx @@ -5,7 +5,6 @@ */ import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { DEFAULT_PLACEHOLDER, TextFilter } from '.'; @@ -14,7 +13,7 @@ describe('TextFilter', () => { describe('rendering', () => { test('renders correctly against snapshot', () => { const wrapper = shallow(); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); describe('placeholder', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/data_driven_columns/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/data_driven_columns/index.test.tsx index 0638f2d96808f..36427015260a7 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/data_driven_columns/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/data_driven_columns/index.test.tsx @@ -4,7 +4,6 @@ * you may not use this file except in compliance with the Elastic License. */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; @@ -29,6 +28,6 @@ describe('Columns', () => { /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/args.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/args.test.tsx index f0d63ff0465cf..53a2054412440 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/args.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/args.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { useMountAppended } from '../../../../utils/use_mount_appended'; @@ -25,7 +24,7 @@ describe('Args', () => { processTitle="process-title-1" /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it returns an empty string when both args and process title are undefined', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/auditd/generic_details.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/auditd/generic_details.test.tsx index 260e713474ac6..21cccc88f4fbc 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/auditd/generic_details.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/auditd/generic_details.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { BrowserFields } from '../../../../../containers/source'; @@ -30,7 +29,7 @@ describe('GenericDetails', () => { timelineId="test" /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it returns auditd if the data does contain auditd data', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/auditd/generic_file_details.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/auditd/generic_file_details.test.tsx index 1abcb459b7720..fce0e1d645e16 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/auditd/generic_file_details.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/auditd/generic_file_details.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { BrowserFields } from '../../../../../containers/source'; @@ -31,7 +30,7 @@ describe('GenericFileDetails', () => { timelineId="test" /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it returns auditd if the data does contain auditd data', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/auditd/generic_row_renderer.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/auditd/generic_row_renderer.test.tsx index 4f66793ffae32..b78d9261849cb 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/auditd/generic_row_renderer.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/auditd/generic_row_renderer.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import { cloneDeep } from 'lodash/fp'; import React from 'react'; @@ -46,7 +45,7 @@ describe('GenericRowRenderer', () => { }); const wrapper = shallow({children}); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('should return false if not a auditd datum', () => { @@ -125,7 +124,7 @@ describe('GenericRowRenderer', () => { }); const wrapper = shallow({children}); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('should return false if not a auditd datum', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/auditd/primary_secondary_user_info.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/auditd/primary_secondary_user_info.test.tsx index 8212f4c9c7974..598769e854b42 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/auditd/primary_secondary_user_info.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/auditd/primary_secondary_user_info.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { TestProviders } from '../../../../../mock'; @@ -26,7 +25,7 @@ describe('UserPrimarySecondary', () => { secondary="secondary-1" /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('should render user name only if that is all that is present', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/auditd/session_user_host_working_dir.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/auditd/session_user_host_working_dir.test.tsx index ec56e38ffade3..a0a9977f5765e 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/auditd/session_user_host_working_dir.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/auditd/session_user_host_working_dir.test.tsx @@ -6,7 +6,6 @@ import { EuiFlexItem } from '@elastic/eui'; import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { TestProviders } from '../../../../../mock'; @@ -32,7 +31,7 @@ describe('SessionUserHostWorkingDir', () => { /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders with just eventId and contextId', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/empty_column_renderer.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/empty_column_renderer.test.tsx index 04f7cd9b560a6..b31d01b8e94a0 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/empty_column_renderer.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/empty_column_renderer.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import { cloneDeep } from 'lodash/fp'; import React from 'react'; @@ -36,7 +35,7 @@ describe('empty_column_renderer', () => { timelineId: 'test', }); const wrapper = shallow({emptyColumn}); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('should return isInstance true if source is empty', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/formatted_field.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/formatted_field.test.tsx index 1e7c3bfedc9b9..73f7b004ca3f7 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/formatted_field.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/formatted_field.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import { get } from 'lodash/fp'; import React from 'react'; @@ -33,7 +32,7 @@ describe('Events', () => { /> ); - expect(toJson(wrapper.find('FormattedFieldValue'))).toMatchSnapshot(); + expect(wrapper.find('FormattedFieldValue')).toMatchSnapshot(); }); test('it renders a localized date tooltip for a field type of date that has a valid timestamp', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/get_column_renderer.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/get_column_renderer.test.tsx index 908e01ef110c0..25d5c71caf48a 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/get_column_renderer.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/get_column_renderer.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import { cloneDeep } from 'lodash/fp'; import React from 'react'; @@ -41,7 +40,7 @@ describe('get_column_renderer', () => { }); const wrapper = shallow({column}); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('should render event severity when dealing with data that is not suricata', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/get_row_renderer.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/get_row_renderer.test.tsx index e73802b9295d6..f367769b78f40 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/get_row_renderer.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/get_row_renderer.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import { cloneDeep } from 'lodash'; import React from 'react'; @@ -44,7 +43,7 @@ describe('get_column_renderer', () => { }); const wrapper = shallow({row}); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('should render plain row data when it is a non suricata row', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/host_working_dir.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/host_working_dir.test.tsx index 6c58b1ec6f35c..d84dfcc561882 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/host_working_dir.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/host_working_dir.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { mockTimelineData, TestProviders } from '../../../../mock'; @@ -24,7 +23,7 @@ describe('HostWorkingDir', () => { workingDirectory="[working-directory-123]" /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders a hostname without a workingDirectory', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/netflow/netflow_row_renderer.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/netflow/netflow_row_renderer.test.tsx index 188e9babfaf45..68629a9a70058 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/netflow/netflow_row_renderer.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/netflow/netflow_row_renderer.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { BrowserFields } from '../../../../../containers/source'; @@ -38,7 +37,7 @@ describe('netflowRowRenderer', () => { }); const wrapper = shallow({children}); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); describe('#isInstance', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/plain_column_renderer.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/plain_column_renderer.test.tsx index 975af67efd763..8a22307767a40 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/plain_column_renderer.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/plain_column_renderer.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import { cloneDeep } from 'lodash/fp'; import React from 'react'; @@ -36,7 +35,7 @@ describe('plain_column_renderer', () => { timelineId: 'test', }); const wrapper = shallow({column}); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('should return isInstance false if source is empty', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/plain_row_renderer.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/plain_row_renderer.test.tsx index 355f3fb248238..50ea7ca05b921 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/plain_row_renderer.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/plain_row_renderer.test.tsx @@ -6,7 +6,6 @@ import euiDarkVars from '@elastic/eui/dist/eui_theme_dark.json'; import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import { cloneDeep } from 'lodash'; import React from 'react'; import { ThemeProvider } from 'styled-components'; @@ -30,7 +29,7 @@ describe('plain_row_renderer', () => { timelineId: 'test', }); const wrapper = shallow({children}); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('should always return isInstance true', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/process_draggable.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/process_draggable.test.tsx index a9dae95d700c3..8cc7323ed358f 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/process_draggable.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/process_draggable.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { TestProviders } from '../../../../mock'; @@ -28,7 +27,7 @@ describe('ProcessDraggable', () => { processPid={123} /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it returns null if everything is null', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/suricata/suricata_details.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/suricata/suricata_details.test.tsx index c8921fb616e56..027aa0df8bcdd 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/suricata/suricata_details.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/suricata/suricata_details.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { mockBrowserFields } from '../../../../../containers/source/mock'; @@ -26,7 +25,7 @@ describe('SuricataDetails', () => { timelineId="test" /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it returns text if the data does contain suricata data', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/suricata/suricata_row_renderer.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/suricata/suricata_row_renderer.test.tsx index be8d557b63811..170d17e8e279e 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/suricata/suricata_row_renderer.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/suricata/suricata_row_renderer.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import { cloneDeep } from 'lodash/fp'; import React from 'react'; @@ -35,7 +34,7 @@ describe('suricata_row_renderer', () => { }); const wrapper = shallow({children}); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('should return false if not a suricata datum', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/suricata/suricata_signature.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/suricata/suricata_signature.test.tsx index 3e643fe5c7830..beae16af558ed 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/suricata/suricata_signature.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/suricata/suricata_signature.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { TestProviders } from '../../../../../mock'; @@ -30,7 +29,7 @@ describe('SuricataSignature', () => { signature="ET SCAN ATTACK Hello" /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/system/auth_ssh.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/system/auth_ssh.test.tsx index 5831af5954507..4e4e1a0b7bf6f 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/system/auth_ssh.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/system/auth_ssh.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { AuthSsh } from './auth_ssh'; @@ -21,7 +20,7 @@ describe('AuthSsh', () => { sshMethod="[ssh-method]" /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it returns null if sshSignature and sshMethod are both null', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/system/generic_details.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/system/generic_details.test.tsx index ca3445c23cecf..19113d93f7cb0 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/system/generic_details.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/system/generic_details.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { BrowserFields } from '../../../../../containers/source'; @@ -30,7 +29,7 @@ describe('SystemGenericDetails', () => { timelineId="test" /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it returns system rendering if the data does contain system data', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/system/generic_file_details.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/system/generic_file_details.test.tsx index cd721b109090f..cab7191c13aef 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/system/generic_file_details.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/system/generic_file_details.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { BrowserFields } from '../../../../../containers/source'; @@ -30,7 +29,7 @@ describe('SystemGenericFileDetails', () => { timelineId="test" /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it returns system rendering if the data does contain system data', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/system/generic_row_renderer.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/system/generic_row_renderer.test.tsx index 4d3f2d71604e8..5f809d595f1b0 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/system/generic_row_renderer.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/system/generic_row_renderer.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import { cloneDeep } from 'lodash/fp'; import React from 'react'; @@ -75,7 +74,7 @@ describe('GenericRowRenderer', () => { }); const wrapper = shallow({children}); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('should return false if not a system datum', () => { @@ -139,7 +138,7 @@ describe('GenericRowRenderer', () => { }); const wrapper = shallow({children}); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('should return false if not a auditd datum', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/system/package.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/system/package.test.tsx index e561ad462ae4e..100c8fbe5a988 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/system/package.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/system/package.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { TestProviders } from '../../../../../mock'; @@ -26,7 +25,7 @@ describe('Package', () => { packageVersion="package-version-123" /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it returns null if all of the package information is null ', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/unknown_column_renderer.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/unknown_column_renderer.test.tsx index 41a71f55cae19..73d1d5cb441ef 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/unknown_column_renderer.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/unknown_column_renderer.test.tsx @@ -6,7 +6,6 @@ import euiDarkVars from '@elastic/eui/dist/eui_theme_dark.json'; import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import { cloneDeep } from 'lodash'; import React from 'react'; import { ThemeProvider } from 'styled-components'; @@ -34,7 +33,7 @@ describe('unknown_column_renderer', () => { timelineId: 'test', }); const wrapper = shallow({emptyColumn}); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('should return isInstance true with a made up column name', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/user_host_working_dir.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/user_host_working_dir.test.tsx index 8ecc917a383b8..45b670acb569a 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/user_host_working_dir.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/user_host_working_dir.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { TestProviders } from '../../../../mock'; @@ -27,7 +26,7 @@ describe('UserHostWorkingDir', () => { workingDirectory="[working-directory-123]" /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it returns null if userDomain, userName, hostName, and workingDirectory are all null', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/zeek/zeek_details.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/zeek/zeek_details.test.tsx index a2c0f0403c801..7617a01acf1d9 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/zeek/zeek_details.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/zeek/zeek_details.test.tsx @@ -4,7 +4,6 @@ * you may not use this file except in compliance with the Elastic License. */ -import toJson from 'enzyme-to-json'; import React from 'react'; import { mockBrowserFields } from '../../../../../containers/source/mock'; @@ -26,7 +25,7 @@ describe('ZeekDetails', () => { /> ); - expect(toJson(wrapper.find('ZeekDetails'))).toMatchSnapshot(); + expect(wrapper.find('ZeekDetails')).toMatchSnapshot(); }); test('it returns zeek.connection if the data does contain zeek.connection data', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/zeek/zeek_row_renderer.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/zeek/zeek_row_renderer.test.tsx index b61b445a5dd75..4242308a55a64 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/zeek/zeek_row_renderer.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/zeek/zeek_row_renderer.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import { cloneDeep } from 'lodash/fp'; import React from 'react'; @@ -34,7 +33,7 @@ describe('zeek_row_renderer', () => { }); const wrapper = shallow({children}); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('should return false if not a zeek datum', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/zeek/zeek_signature.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/zeek/zeek_signature.test.tsx index 763d10e732c57..c09bd6b7a356d 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/zeek/zeek_signature.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/renderers/zeek/zeek_signature.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import { cloneDeep } from 'lodash/fp'; import React from 'react'; @@ -37,7 +36,7 @@ describe('ZeekSignature', () => { describe('rendering', () => { test('it renders the default Zeek', () => { const wrapper = shallow(); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/body/sort/sort_indicator.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/body/sort/sort_indicator.test.tsx index f3116bc2f4bf4..db3e96a4e2650 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/body/sort/sort_indicator.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/body/sort/sort_indicator.test.tsx @@ -5,7 +5,6 @@ */ import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { Direction } from '../../../../graphql/types'; @@ -16,7 +15,7 @@ describe('SortIndicator', () => { describe('rendering', () => { test('renders correctly against snapshot', () => { const wrapper = shallow(); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders the sort indicator', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/data_providers/data_providers.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/data_providers/data_providers.test.tsx index 43425bd6c5130..a88062d9093d7 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/data_providers/data_providers.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/data_providers/data_providers.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { TestProviders } from '../../../mock/test_providers'; @@ -36,7 +35,7 @@ describe('DataProviders', () => { show={true} /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it should render a placeholder when there are zero data providers', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/data_providers/empty.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/data_providers/empty.test.tsx index 18bb0b20b3061..10586657b52a3 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/data_providers/empty.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/data_providers/empty.test.tsx @@ -5,7 +5,6 @@ */ import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { Empty } from './empty'; @@ -15,7 +14,7 @@ describe('Empty', () => { describe('rendering', () => { test('renders correctly against snapshot', () => { const wrapper = shallow(); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); const dropMessage = ['Drop', 'anything', 'highlighted', 'here']; diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/data_providers/provider.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/data_providers/provider.test.tsx index e47117c9550fe..f0d7ca83fb391 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/data_providers/provider.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/data_providers/provider.test.tsx @@ -5,7 +5,6 @@ */ import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { TestProviders } from '../../../mock/test_providers'; @@ -17,7 +16,7 @@ describe('Provider', () => { describe('rendering', () => { test('renders correctly against snapshot', () => { const wrapper = shallow(); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders the data provider', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/data_providers/providers.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/data_providers/providers.test.tsx index 246fefda8d523..d8076ac90e6b2 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/data_providers/providers.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/data_providers/providers.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { TestProviders } from '../../../mock/test_providers'; @@ -36,7 +35,7 @@ describe('Providers', () => { onToggleDataProviderExcluded={jest.fn()} /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders the data providers', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/footer/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/footer/index.test.tsx index 2d8c0e7302944..b6ca4fe125c69 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/footer/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/footer/index.test.tsx @@ -5,7 +5,6 @@ */ import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import { getOr } from 'lodash/fp'; import React from 'react'; @@ -41,7 +40,7 @@ describe('Footer Timeline Component', () => { /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders the loading panel at the beginning ', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/header/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/header/index.test.tsx index d8f56507bf365..5af7aff4f8795 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/header/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/header/index.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { Direction } from '../../../graphql/types'; @@ -44,7 +43,7 @@ describe('Header', () => { }} /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders the data providers', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/timeline.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/timeline.test.tsx index 34e62cf2c2247..2971053bc5252 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/timeline.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/timeline.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { MockedProvider } from 'react-apollo/test-utils'; @@ -78,7 +77,7 @@ describe('Timeline', () => { toggleColumn={jest.fn()} /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders the timeline header', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/toasters/modal_all_errors.test.tsx b/x-pack/legacy/plugins/siem/public/components/toasters/modal_all_errors.test.tsx index 7c19b61c4b49d..bfca035e891e8 100644 --- a/x-pack/legacy/plugins/siem/public/components/toasters/modal_all_errors.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/toasters/modal_all_errors.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; @@ -30,7 +29,7 @@ describe('Modal all errors', () => { const wrapper = shallow( ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders null when isShowing is negative', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/truncatable_text/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/truncatable_text/index.test.tsx index e4c799822ba17..92868b23a3ccd 100644 --- a/x-pack/legacy/plugins/siem/public/components/truncatable_text/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/truncatable_text/index.test.tsx @@ -5,7 +5,6 @@ */ import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { TruncatableText } from '.'; @@ -13,7 +12,7 @@ import { TruncatableText } from '.'; describe('TruncatableText', () => { test('renders correctly against snapshot', () => { const wrapper = shallow({'Hiding in plain sight'}); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it adds the hidden overflow style', () => { diff --git a/x-pack/legacy/plugins/siem/public/components/wrapper_page/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/wrapper_page/index.test.tsx index 5d73e9bcf8e71..788ea14f4bd22 100644 --- a/x-pack/legacy/plugins/siem/public/components/wrapper_page/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/wrapper_page/index.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { TestProviders } from '../../mock'; @@ -21,7 +20,7 @@ describe('WrapperPage', () => { ); - expect(toJson(wrapper.find('WrapperPage'))).toMatchSnapshot(); + expect(wrapper.find('WrapperPage')).toMatchSnapshot(); }); describe('restrict width', () => { @@ -34,7 +33,7 @@ describe('WrapperPage', () => { ); - expect(toJson(wrapper.find('WrapperPage'))).toMatchSnapshot(); + expect(wrapper.find('WrapperPage')).toMatchSnapshot(); }); test('custom max width when restrictWidth is number', () => { @@ -46,7 +45,7 @@ describe('WrapperPage', () => { ); - expect(toJson(wrapper.find('WrapperPage'))).toMatchSnapshot(); + expect(wrapper.find('WrapperPage')).toMatchSnapshot(); }); test('custom max width when restrictWidth is string', () => { @@ -58,7 +57,7 @@ describe('WrapperPage', () => { ); - expect(toJson(wrapper.find('WrapperPage'))).toMatchSnapshot(); + expect(wrapper.find('WrapperPage')).toMatchSnapshot(); }); }); }); diff --git a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/import_rule_modal/index.test.tsx b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/import_rule_modal/index.test.tsx index 7544edac5a550..e10194853e7f9 100644 --- a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/import_rule_modal/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/import_rule_modal/index.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { ImportRuleModalComponent } from './index'; @@ -20,6 +19,6 @@ describe('ImportRuleModal', () => { importComplete={jest.fn()} /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/json_downloader/index.test.tsx b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/json_downloader/index.test.tsx index e5ba3b8d6ddbd..859918cdc8e60 100644 --- a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/json_downloader/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/json_downloader/index.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { JSONDownloaderComponent, jsonToNDJSON, ndjsonToJSON } from './index'; @@ -37,7 +36,7 @@ describe('JSONDownloader', () => { const wrapper = shallow( ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); describe('jsonToNDJSON', () => { diff --git a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/rule_switch/index.test.tsx b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/rule_switch/index.test.tsx index 3fc29c472e4d7..104eff34c91b3 100644 --- a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/rule_switch/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/rule_switch/index.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import React from 'react'; import { RuleSwitchComponent } from './index'; @@ -15,6 +14,6 @@ describe('RuleSwitch', () => { const wrapper = shallow( ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/siem/public/pages/network/ip_details/index.test.tsx b/x-pack/legacy/plugins/siem/public/pages/network/ip_details/index.test.tsx index 347f15ed0a849..9a9d1cf085eb9 100644 --- a/x-pack/legacy/plugins/siem/public/pages/network/ip_details/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/network/ip_details/index.test.tsx @@ -5,7 +5,6 @@ */ import { shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; import { cloneDeep } from 'lodash/fp'; import React from 'react'; import { Router } from 'react-router-dom'; @@ -129,7 +128,7 @@ describe('Ip Details', () => { test('it matches the snapshot', () => { const wrapper = shallow(); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders ipv6 headline', async () => {