From f8d3af252be66ef305b1a6ec8e294e660475f24b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Kopycin=CC=81ski?= Date: Sat, 4 Jan 2020 16:40:43 +0100 Subject: [PATCH] [SIEM] Cleanup unnecessary use of enzyme-to-json --- .../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 10d3c899562e8..ebe1aaeaec5e4 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 * as 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 77a7296e368cf..5aa370a7da026 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 * as 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 1a8af9d99193a..574c98833a262 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 * as 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 4b546bca1f72e..550aff73832b0 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 * as 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 056669673bb9e..eae6c8a6d7494 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 * as 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 f1ed533bef545..ebb5180914d73 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 * as 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 007916595fd6a..48f3693b9c24b 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 * as 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 d04329edff475..7c2874e7f7d8f 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 * as 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 c43ab1ff4a036..d2984d32d0c4e 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 * as 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 13eefb252fb04..fcc23179b3b93 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 * as 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 929b4983b5fd7..b96397f80d89e 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 * as 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 4c77570cfbc9f..a305951b4e625 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 * as 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 6233fcfe7c823..6f33fac98cd9d 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 * as 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 d97da7797bb45..724ffca1ea178 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 * as 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 429fc94b2f2d3..cd91047d9d9ea 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 * as 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 e45f5dacb36a2..1407e954aaa5e 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 * as 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 47f0aef4b4806..b6105c4a1a736 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 * as 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 b1f757841e54b..afe29ebf6e5df 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 * as 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 be7e8fac70bf5..02b79bba85b3a 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 * as 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 246261035508b..4bbcf4f3f4bc1 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 * as React from 'react'; import { TestProviders } from '../../../mock'; @@ -34,7 +33,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 8c27a55d3a6b0..de225d1581a13 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 * as React from 'react'; import { mockFrameworks, getMockKibanaUiSetting } from '../../mock'; @@ -30,7 +29,7 @@ describe('formatted_bytes', () => { getMockKibanaUiSetting(mockFrameworks.default_browser) ); const wrapper = shallow(); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders bytes to hardcoded format when no configuration 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 dad1d5feb5c6e..ca9d0dca74ffd 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 moment from 'moment-timezone'; import * as React from 'react'; @@ -34,7 +33,7 @@ describe('formatted_date', () => { test('renders correctly against snapshot', () => { mockUseUiSetting$.mockImplementation(() => [null]); const wrapper = mount(); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('it renders the UTC ISO8601 date string supplied when no configuration exists', () => { 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 2dda3eca563fe..05f62421ce1c1 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 * as 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 56c215218ad5e..6f46fcc8ca129 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 * as 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 80ccd07c30249..7564feb045d88 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 * as 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 cf24d6c02a138..1442b06423393 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 * as 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 759e84e36f4ac..c4098a6339c5f 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 * as 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 f00fb62d74ac3..c057f4a64cc65 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 * as 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 542529c628b72..9876b54ea3a4c 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 * as 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 0711cc1c87966..161a74642f299 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 * as 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 91e5510f4938d..5e3b8258b0d11 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 * as 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 691d43a8b18b3..93ea94a2aba1b 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 * as 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 2e2445fe933bb..ad3903f366edb 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 * as 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 d409f5de200a4..890038e93f70c 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 * as 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 c522b7750c414..6df9013740e72 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 * as 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 22531983b2399..caec901fef0fe 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 * as 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 fc76780ef80c7..c44ca62429a98 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 * as 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 3ab556a4e5dc4..8b87765f26cae 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 * as 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 b6cd23496b190..237c00605cfcd 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 * as 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 70e75cb54671a..5b1ab73f49d77 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 * as 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 71e61e2425373..fc2be63412c4d 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 * as 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 830665f827301..b753c08ad837e 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 * as 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 4728925eb741a..584617ca5ac40 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 * as 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 28ddb1df12c3a..d7160b74c9f07 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 * as 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 6c2edd764855c..afaa896bd5bd0 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 * as 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 964617c4c85b1..e0c90d927f0ff 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 * as 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 b88653bcadde8..0aac289ebde36 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 * as 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 e39723f57f0b0..9794716145aec 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 * as 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 81e0c7fad7b39..118cc2e643023 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 * as 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 8fd245b077243..ad0f7a577af4b 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 * as 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 5c4aa862283f2..45b5fc315f0b3 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 * as 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 920d1cd8210e5..6983d38879487 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 * as 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 d01923f01543f..9b431f73a4abc 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 * as 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 d324df2ecb0c1..f0215d42225c2 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 * as 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 1b28c032221ab..f6e2662b407f8 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 * as 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 0444360d2b965..d90d4b88407e6 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 * as 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 330385e39ca79..5b74cb073ff62 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 * as 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 f1580b59362bf..7a391c519cf70 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 * as 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 95c68d0233c69..f234ef1356ac1 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 * as 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 c437994145d63..fcbc2b94954e3 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 * as 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 ed3eaa6cf1e91..3b2a044dad256 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 @@ -6,7 +6,6 @@ import euiDarkVars from '@elastic/eui/dist/eui_theme_dark.json'; import { mount, ReactWrapper } from 'enzyme'; -import toJson from 'enzyme-to-json'; import * as React from 'react'; import { ThemeProvider } from 'styled-components'; @@ -91,7 +90,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', () => { @@ -180,7 +179,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 d864d4306b8ef..0ece01d49754f 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 * as 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 d93983d7d4054..c203ba379dab9 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 * as 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 bfcf3cd639799..adedcdbcad01b 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 * as 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 da348590bd044..f9c358cd5951e 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 * as 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 7765b0360d35b..b2f530b73624a 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 * as 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 c6b1ee056ebcc..3a434317f4a6c 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 * as 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 f5b33296561c7..58b2329151443 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 * as 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 ad904554e33ad..b5250249eece4 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 * as 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 8d3a713369031..1355dab26bd7a 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 * as 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 af4971faae295..0b71f0c944fe4 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 * as 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 f2cce8b16b5d6..86a5168ab47a9 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 * as 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 a5b861be08e56..e826526f85a12 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 * as 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 2240d83169e0d..423173e4d5877 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 * as 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 5c54e5be3374c..21c0284fb8bbc 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 @@ -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 { get } from 'lodash/fp'; import * as React from 'react'; import { ThemeProvider } from 'styled-components'; @@ -34,7 +33,7 @@ describe('Events', () => { value={get('timestamp', mockTimelineData[0].ecs)} /> ); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).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 d445ec2859e2c..34a60cd5cc562 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 * as 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 bea525116021d..2ce4f1b50bfe0 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 * as 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 6ba8f3f28dae8..d8bc95eade143 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 * as 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 008885b5264c8..46689658e00af 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 moment from 'moment-timezone'; import * as React from 'react'; @@ -41,7 +40,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 ff1cb60db0d93..d88756ea542c5 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 * as 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 3f77726474c56..b462e49b7bd6d 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 * as 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 66c9613c02995..4515e22458a70 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 * as 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 4eefb4b0bc8b9..e060abd966d45 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 * as 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 e42a91b7d7972..3ddd9f37dd430 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 * as 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 54f5b2f165287..87dd0e8b0bec1 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 * as 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 d4260d9bd183a..6cf677239e851 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 * as 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 b2dbdb6b0e45c..4b92b52ac0fc8 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 * as React from 'react'; @@ -77,7 +76,7 @@ describe('GenericRowRenderer', () => { }); const wrapper = shallow({children}); - expect(toJson(wrapper)).toMatchSnapshot(); + expect(wrapper).toMatchSnapshot(); }); test('should return false if not a system datum', () => { @@ -141,7 +140,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 167abe2185bcc..afe9480a58736 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 * as 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 662392078f38a..bb2c6657bde77 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 * as 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 73b90410bc803..5f2d02f261ff7 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 * as 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 b4fd9a978b7d8..9baa4cb6f99c3 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 * as 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 4ef2bb89e05ca..ae382a8267428 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 * as 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 cda1fe0844e00..0644d784e2d83 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 * as 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 d67c6c9648a15..cb7997ec7b4b5 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 * as 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 c249e263d1205..fd7f56bb24e0a 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 * as 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 aa3f07cb1b17a..9395a64ce3a52 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 * as 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 c9454846c5548..4396f7a4e4a68 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 * as 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 07b7741e5c152..a18f668e67073 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 * as 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 4527e39128f89..5151ac5ccbea0 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 * as 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 bb500de239da7..d3ffc7cc9cae1 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 * as 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 3a7774298f6af..2a8d1265bedc1 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 * as 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 8c5a08fdf5e21..76da9c4d94420 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 * as 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 381a3138bf617..04aa3d7687c83 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 * as 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 d7a508e2c53e3..3a74bad62f852 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 * as 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 7a3a99b183971..2c6136bede4d1 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 * as React from 'react'; import { RuleSwitchComponent } from './index'; @@ -16,6 +15,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 d624631c1feae..5568860847614 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 * as React from 'react'; import { Router } from 'react-router-dom'; @@ -131,7 +130,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 () => {