mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[SIEM] Cleanup unnecessary use of enzyme-to-json (#53980)
This commit is contained in:
parent
b7284ca627
commit
8eb000d629
134 changed files with 158 additions and 292 deletions
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { mount } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
|
||||
import { TestProviders } from '../../mock';
|
||||
|
@ -20,7 +19,7 @@ describe('arrows', () => {
|
|||
<ArrowBody height={3} />
|
||||
</TestProviders>
|
||||
);
|
||||
expect(toJson(wrapper.find('ArrowBody'))).toMatchSnapshot();
|
||||
expect(wrapper.find('ArrowBody')).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
import { EuiFieldSearch } from '@elastic/eui';
|
||||
import euiDarkVars from '@elastic/eui/dist/eui_theme_dark.json';
|
||||
import { mount, shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import { noop } from 'lodash/fp';
|
||||
import React from 'react';
|
||||
import { ThemeProvider } from 'styled-components';
|
||||
|
@ -117,7 +116,7 @@ describe('Autocomplete', () => {
|
|||
value={''}
|
||||
/>
|
||||
);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it is rendering with placeholder', () => {
|
||||
|
|
|
@ -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', () => {
|
|||
</TestProviders>
|
||||
);
|
||||
|
||||
expect(toJson(wrapper.find('UtilityBar'))).toMatchSnapshot();
|
||||
expect(wrapper.find('UtilityBar')).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it applies border styles when border is true', () => {
|
||||
|
|
|
@ -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', () => {
|
|||
</TestProviders>
|
||||
);
|
||||
|
||||
expect(toJson(wrapper.find('UtilityBarAction'))).toMatchSnapshot();
|
||||
expect(wrapper.find('UtilityBarAction')).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it renders a popover', () => {
|
||||
|
|
|
@ -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', () => {
|
|||
</TestProviders>
|
||||
);
|
||||
|
||||
expect(toJson(wrapper.find('UtilityBarGroup'))).toMatchSnapshot();
|
||||
expect(wrapper.find('UtilityBarGroup')).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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', () => {
|
|||
</TestProviders>
|
||||
);
|
||||
|
||||
expect(toJson(wrapper.find('UtilityBarSection'))).toMatchSnapshot();
|
||||
expect(wrapper.find('UtilityBarSection')).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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', () => {
|
|||
</TestProviders>
|
||||
);
|
||||
|
||||
expect(toJson(wrapper.find('UtilityBarText'))).toMatchSnapshot();
|
||||
expect(wrapper.find('UtilityBarText')).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { mount, shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
import { MockedProvider } from 'react-apollo/test-utils';
|
||||
|
||||
|
@ -28,7 +27,7 @@ describe('DragDropContextWrapper', () => {
|
|||
</MockedProvider>
|
||||
</TestProviders>
|
||||
);
|
||||
expect(toJson(wrapper.find('DragDropContextWrapper'))).toMatchSnapshot();
|
||||
expect(wrapper.find('DragDropContextWrapper')).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it renders the children', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
import { MockedProvider } from 'react-apollo/test-utils';
|
||||
|
||||
|
@ -33,7 +32,7 @@ describe('DraggableWrapper', () => {
|
|||
</TestProviders>
|
||||
);
|
||||
|
||||
expect(toJson(wrapper.find('DraggableWrapper'))).toMatchSnapshot();
|
||||
expect(wrapper.find('DraggableWrapper')).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it renders the children passed to the render prop', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
import { MockedProvider } from 'react-apollo/test-utils';
|
||||
|
||||
|
@ -33,7 +32,7 @@ describe('DroppableWrapper', () => {
|
|||
</TestProviders>
|
||||
);
|
||||
|
||||
expect(toJson(wrapper.find('DroppableWrapper'))).toMatchSnapshot();
|
||||
expect(wrapper.find('DroppableWrapper')).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it renders the children when a render prop is not provided', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
|
||||
import { TestProviders } from '../../mock';
|
||||
|
@ -34,7 +33,7 @@ describe('draggables', () => {
|
|||
<span>{'A child of this'}</span>
|
||||
</DefaultDraggable>
|
||||
);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it renders the default Badge', () => {
|
||||
|
@ -50,7 +49,7 @@ describe('draggables', () => {
|
|||
<span>{'A child of this'}</span>
|
||||
</DraggableBadge>
|
||||
);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -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', () => {
|
|||
</Embeddable>
|
||||
);
|
||||
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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(<EmbeddableHeader title="Test title" />);
|
||||
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it renders the title', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
|
||||
import { useIndexPatterns } from '../../hooks/use_index_patterns';
|
||||
|
@ -41,6 +40,6 @@ describe('EmbeddedMapComponent', () => {
|
|||
startDate={new Date('2019-08-28T05:50:47.877Z').getTime()}
|
||||
/>
|
||||
);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
|
||||
import { IndexPatternsMissingPromptComponent } from './index_patterns_missing_prompt';
|
||||
|
@ -15,6 +14,6 @@ jest.mock('../../lib/kibana');
|
|||
describe('IndexPatternsMissingPrompt', () => {
|
||||
test('renders correctly against snapshot', () => {
|
||||
const wrapper = shallow(<IndexPatternsMissingPromptComponent />);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
import { LineToolTipContentComponent } from './line_tool_tip_content';
|
||||
import { FeatureProperty } from '../types';
|
||||
|
@ -27,6 +26,6 @@ describe('LineToolTipContent', () => {
|
|||
const wrapper = shallow(
|
||||
<LineToolTipContentComponent contextId={'contextId'} featureProps={mockFeatureProps} />
|
||||
);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
import { MapToolTipComponent } from './map_tool_tip';
|
||||
import { MapFeature } from '../types';
|
||||
|
@ -19,7 +18,7 @@ jest.mock('../../search_bar', () => ({
|
|||
describe('MapToolTip', () => {
|
||||
test('placeholder component renders correctly against snapshot', () => {
|
||||
const wrapper = shallow(<MapToolTipComponent />);
|
||||
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();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
import { FeatureProperty } from '../types';
|
||||
import { getRenderedFieldValue, PointToolTipContentComponent } from './point_tool_tip_content';
|
||||
|
@ -49,7 +48,7 @@ describe('PointToolTipContent', () => {
|
|||
/>
|
||||
</TestProviders>
|
||||
);
|
||||
expect(toJson(wrapper.find('PointToolTipContentComponent'))).toMatchSnapshot();
|
||||
expect(wrapper.find('PointToolTipContentComponent')).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('renders array filter correctly', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { mount, shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
import { ToolTipFooterComponent } from './tooltip_footer';
|
||||
|
||||
|
@ -27,7 +26,7 @@ describe('ToolTipFilter', () => {
|
|||
totalFeatures={100}
|
||||
/>
|
||||
);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
describe('Lower bounds', () => {
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
|
|
|
@ -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(<p>{getEmptyString()}</p>);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
describe('#getEmptyValue', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
import { Provider } from 'react-redux';
|
||||
|
||||
|
@ -30,7 +29,7 @@ describe('Error Toast Dispatcher', () => {
|
|||
<ErrorToastDispatcher toastLifeTimeMs={9999999999} />
|
||||
</Provider>
|
||||
);
|
||||
expect(toJson(wrapper.find('Connect(ErrorToastDispatcherComponent)'))).toMatchSnapshot();
|
||||
expect(wrapper.find('Connect(ErrorToastDispatcherComponent)')).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
|
||||
import { mockDetailItemData, mockDetailItemDataId } from '../../mock/mock_detail_item';
|
||||
|
@ -34,7 +33,7 @@ describe('EventDetails', () => {
|
|||
toggleColumn={jest.fn()}
|
||||
/>
|
||||
);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
|
||||
import { mockDetailItemData } from '../../mock';
|
||||
|
@ -16,7 +15,7 @@ describe('JSON View', () => {
|
|||
describe('rendering', () => {
|
||||
test('should match snapshot', () => {
|
||||
const wrapper = shallow(<JsonView data={mockDetailItemData} />);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
|
||||
import { FlowTarget, GetIpOverviewQuery, HostEcsFields } from '../../graphql/types';
|
||||
|
@ -37,7 +36,7 @@ describe('Field Renderers', () => {
|
|||
locationRenderer(['source.geo.city_name', 'source.geo.region_name'], mockData.complete)
|
||||
);
|
||||
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it renders emptyTagValue when no fields provided', () => {
|
||||
|
@ -61,7 +60,7 @@ describe('Field Renderers', () => {
|
|||
test('it renders correctly against snapshot', () => {
|
||||
const wrapper = shallow(dateRenderer(mockData.complete.source!.firstSeen));
|
||||
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it renders emptyTagValue when invalid field provided', () => {
|
||||
|
@ -79,7 +78,7 @@ describe('Field Renderers', () => {
|
|||
autonomousSystemRenderer(mockData.complete.source!.autonomousSystem!, FlowTarget.source)
|
||||
);
|
||||
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it renders emptyTagValue when non-string field provided', () => {
|
||||
|
@ -111,7 +110,7 @@ describe('Field Renderers', () => {
|
|||
test('it renders correctly against snapshot', () => {
|
||||
const wrapper = shallow(hostNameRenderer(mockData.complete.host, '10.10.10.10'));
|
||||
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it renders emptyTagValue when non-matching IP is provided', () => {
|
||||
|
@ -154,7 +153,7 @@ describe('Field Renderers', () => {
|
|||
test('it renders correctly against snapshot', () => {
|
||||
const wrapper = shallow(hostNameRenderer(mockData.complete.host, '10.10.10.10'));
|
||||
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it renders emptyTagValue when non-matching IP is provided', () => {
|
||||
|
@ -188,7 +187,7 @@ describe('Field Renderers', () => {
|
|||
test('it renders correctly against snapshot', () => {
|
||||
const wrapper = shallow(whoisRenderer('10.10.10.10'));
|
||||
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -196,7 +195,7 @@ describe('Field Renderers', () => {
|
|||
test('it renders correctly against snapshot', () => {
|
||||
const wrapper = shallow(<TestProviders>{reputationRenderer('10.10.10.10')}</TestProviders>);
|
||||
|
||||
expect(toJson(wrapper.find('DragDropContext'))).toMatchSnapshot();
|
||||
expect(wrapper.find('DragDropContext')).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -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', () => {
|
|||
</FiltersGlobal>
|
||||
);
|
||||
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { mount, shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
|
||||
import { FlowDirection } from '../../graphql/types';
|
||||
|
@ -25,7 +24,7 @@ describe('Select Flow Direction', () => {
|
|||
/>
|
||||
);
|
||||
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { mount, shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import { clone } from 'lodash/fp';
|
||||
import React from 'react';
|
||||
import { ActionCreator } from 'typescript-fsa';
|
||||
|
@ -31,7 +30,7 @@ describe('FlowTargetSelect Component', () => {
|
|||
test('it renders the FlowTargetSelect', () => {
|
||||
const wrapper = shallow(<FlowTargetSelect {...mockProps} />);
|
||||
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { mount, shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import { set } from 'lodash/fp';
|
||||
import React from 'react';
|
||||
import { ActionCreator } from 'typescript-fsa';
|
||||
|
@ -35,7 +34,7 @@ describe('Flyout', () => {
|
|||
/>
|
||||
</TestProviders>
|
||||
);
|
||||
expect(toJson(wrapper.find('Flyout'))).toMatchSnapshot();
|
||||
expect(wrapper.find('Flyout')).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it renders the default flyout state as a button', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { mount, shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
|
||||
import { TestProviders } from '../../../mock';
|
||||
|
@ -32,7 +31,7 @@ describe('Pane', () => {
|
|||
</Pane>
|
||||
</TestProviders>
|
||||
);
|
||||
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', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { mount, shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
|
||||
import { useUiSetting$ } from '../../lib/kibana';
|
||||
|
@ -23,7 +22,7 @@ describe('PreferenceFormattedBytes', () => {
|
|||
mockUseUiSetting$.mockImplementation(() => [DEFAULT_BYTES_FORMAT_VALUE]);
|
||||
const wrapper = shallow(<PreferenceFormattedBytesComponent value={bytes} />);
|
||||
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it renders bytes to Numeral formatting when no format setting exists', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { mount, shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
|
||||
import { useDateFormat, useTimeZone } from '../../hooks';
|
||||
|
@ -34,7 +33,7 @@ describe('formatted_date', () => {
|
|||
mockUseDateFormat.mockImplementation(() => '');
|
||||
const wrapper = mount(<PreferenceFormattedDate value={isoDate} />);
|
||||
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it renders the date with the default configuration', () => {
|
||||
|
|
|
@ -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(<HeaderGlobal />);
|
||||
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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', () => {
|
|||
</HeaderPage>
|
||||
);
|
||||
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it renders the title', () => {
|
||||
|
|
|
@ -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(<HeaderSection title="Test title" />);
|
||||
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it renders the title', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
|
||||
import { TestProviders } from '../../mock/test_providers';
|
||||
|
@ -20,7 +19,7 @@ describe('Port', () => {
|
|||
const wrapper = shallow(
|
||||
<Ip contextId="test" eventId="abcd" fieldName="destination.ip" value="10.1.2.3" />
|
||||
);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it renders the the ip address', () => {
|
||||
|
|
|
@ -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', () => {
|
|||
</LinkIcon>
|
||||
);
|
||||
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it renders an action button when onClick is provided', () => {
|
||||
|
|
|
@ -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'}
|
||||
</Loader>
|
||||
);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
import { mount, shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
|
||||
import { Markdown } from '.';
|
||||
|
@ -98,7 +97,7 @@ describe('Markdown', () => {
|
|||
test('it renders the expected table content', () => {
|
||||
const wrapper = shallow(<Markdown raw={rawTable} />);
|
||||
|
||||
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(<Markdown raw={markdownWithLink} />);
|
||||
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { mount, shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
|
||||
import { MarkdownHintComponent } from './markdown_hint';
|
||||
|
@ -89,7 +88,7 @@ describe('MarkdownHintComponent ', () => {
|
|||
test('it renders the expected hints', () => {
|
||||
const wrapper = shallow(<MarkdownHintComponent show={true} />);
|
||||
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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', () => {
|
||||
|
|
|
@ -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(<span>{createInfluencers(anomalies.anomalies[0].influencers)}</span>);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it returns an empty string when influencers is undefined', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import { cloneDeep } from 'lodash/fp';
|
||||
import React from 'react';
|
||||
import { AnomalyScoreComponent } from './anomaly_score';
|
||||
|
@ -36,7 +35,7 @@ describe('anomaly_scores', () => {
|
|||
narrowDateRange={narrowDateRange}
|
||||
/>
|
||||
);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('should not show a popover on initial render', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import { cloneDeep } from 'lodash/fp';
|
||||
import React from 'react';
|
||||
import { AnomalyScoresComponent, createJobKey } from './anomaly_scores';
|
||||
|
@ -36,7 +35,7 @@ describe('anomaly_scores', () => {
|
|||
narrowDateRange={narrowDateRange}
|
||||
/>
|
||||
);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('renders spinner when isLoading is true is passed', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow, mount } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
import { mockAnomalies } from '../mock';
|
||||
import { createDescriptionList } from './create_description_list';
|
||||
|
@ -35,7 +34,7 @@ describe('create_description_list', () => {
|
|||
)}
|
||||
/>
|
||||
);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it calls the narrow date range function on click', () => {
|
||||
|
|
|
@ -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(
|
||||
<DraggableScoreComponent id="some-id" index={0} score={anomalies.anomalies[0]} />
|
||||
);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('renders correctly against snapshot when the index is not included', () => {
|
||||
const wrapper = shallow(
|
||||
<DraggableScoreComponent id="some-id" score={anomalies.anomalies[0]} />
|
||||
);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { mount, shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
import { GroupsFilterPopoverComponent } from './groups_filter_popover';
|
||||
import { mockSiemJobs } from '../../__mocks__/api';
|
||||
|
@ -23,7 +22,7 @@ describe('GroupsFilterPopover', () => {
|
|||
const wrapper = shallow(
|
||||
<GroupsFilterPopoverComponent siemJobs={siemJobs} onSelectedGroupsChanged={jest.fn()} />
|
||||
);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('when a filter is clicked, it becomes checked ', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { mount, shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
import { JobsTableFiltersComponent } from './jobs_table_filters';
|
||||
import { SiemJob } from '../../types';
|
||||
|
@ -23,7 +22,7 @@ describe('JobsTableFilters', () => {
|
|||
const wrapper = shallow(
|
||||
<JobsTableFiltersComponent siemJobs={siemJobs} onFilterChanged={jest.fn()} />
|
||||
);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('when you click Elastic Jobs filter, state is updated and it is selected', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow, mount } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
|
||||
import { isChecked, isFailure, isJobLoading, JobSwitchComponent } from './job_switch';
|
||||
|
@ -29,7 +28,7 @@ describe('JobSwitch', () => {
|
|||
onJobStateChange={onJobStateChangeMock}
|
||||
/>
|
||||
);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('should call onJobStateChange when the switch is clicked to be true/open', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow, mount } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
import { JobsTableComponent } from './jobs_table';
|
||||
import { mockSiemJobs } from '../__mocks__/api';
|
||||
|
@ -28,7 +27,7 @@ describe('JobsTableComponent', () => {
|
|||
onJobStateChange={onJobStateChangeMock}
|
||||
/>
|
||||
);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('should render the hyperlink which points specifically to the job id', () => {
|
||||
|
|
|
@ -5,13 +5,12 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
import { ShowingCountComponent } from './showing_count';
|
||||
|
||||
describe('ShowingCount', () => {
|
||||
test('renders correctly against snapshot', () => {
|
||||
const wrapper = shallow(<ShowingCountComponent filterResultsLength={2} />);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -5,13 +5,12 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
import { PopoverDescriptionComponent } from './popover_description';
|
||||
|
||||
describe('JobsTableFilters', () => {
|
||||
test('renders correctly against snapshot', () => {
|
||||
const wrapper = shallow(<PopoverDescriptionComponent />);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -5,13 +5,12 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
import { UpgradeContentsComponent } from './upgrade_contents';
|
||||
|
||||
describe('JobsTableFilters', () => {
|
||||
test('renders correctly against snapshot', () => {
|
||||
const wrapper = shallow(<UpgradeContentsComponent />);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import toJson from 'enzyme-to-json';
|
||||
import { get } from 'lodash/fp';
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
@ -123,7 +122,7 @@ describe('Netflow', () => {
|
|||
|
||||
test('renders correctly against snapshot', () => {
|
||||
const wrapper = shallow(getNetflowInstance());
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it renders a destination label', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { mount, shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
|
||||
import { AddNote } from '.';
|
||||
|
@ -24,7 +23,7 @@ describe('AddNote', () => {
|
|||
updateNote={jest.fn()}
|
||||
/>
|
||||
);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it renders the Cancel button when onCancelAddNote is provided', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { mount, shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
|
||||
import * as i18n from '../translations';
|
||||
|
@ -19,7 +18,7 @@ describe('NewNote', () => {
|
|||
const wrapper = shallow(
|
||||
<NewNote noteInputHeight={200} note={note} updateNewNote={jest.fn()} />
|
||||
);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it renders a tab labeled "Note"', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { mount, shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
import { ThemeProvider } from 'styled-components';
|
||||
import euiDarkVars from '@elastic/eui/dist/eui_theme_dark.json';
|
||||
|
@ -24,7 +23,7 @@ describe('NoteCardBody', () => {
|
|||
<NoteCardBody rawNote={rawNote} />
|
||||
</ThemeProvider>
|
||||
);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it renders the text of the note in an h1', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { mount, shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
|
||||
import { apolloClientObservable, mockGlobalState, TestProviders } from '../../../mock';
|
||||
|
@ -63,7 +62,7 @@ describe('AddFilterToGlobalSearchBar Component', () => {
|
|||
</AddFilterToGlobalSearchBar>
|
||||
);
|
||||
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('Rendering tooltip', async () => {
|
||||
|
|
|
@ -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', () => {
|
|||
</TestProviders>
|
||||
);
|
||||
|
||||
expect(toJson(wrapper.find('HistogramSignals'))).toMatchSnapshot();
|
||||
expect(wrapper.find('HistogramSignals')).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import { getOr } from 'lodash/fp';
|
||||
import React from 'react';
|
||||
import { Provider as ReduxStoreProvider } from 'react-redux';
|
||||
|
@ -49,7 +48,7 @@ describe('Authentication Table Component', () => {
|
|||
</ReduxStoreProvider>
|
||||
);
|
||||
|
||||
expect(toJson(wrapper.find('Connect(AuthenticationTableComponent)'))).toMatchSnapshot();
|
||||
expect(wrapper.find('Connect(AuthenticationTableComponent)')).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
import { TestProviders } from '../../../../mock';
|
||||
|
||||
|
@ -31,7 +30,7 @@ describe('Host Summary Component', () => {
|
|||
</TestProviders>
|
||||
);
|
||||
|
||||
expect(toJson(wrapper.find('HostOverview'))).toMatchSnapshot();
|
||||
expect(wrapper.find('HostOverview')).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import { getOr } from 'lodash/fp';
|
||||
import React from 'react';
|
||||
import { MockedProvider } from 'react-apollo/test-utils';
|
||||
|
@ -61,7 +60,7 @@ describe('Hosts Table', () => {
|
|||
</TestProviders>
|
||||
);
|
||||
|
||||
expect(toJson(wrapper.find('HostsTable'))).toMatchSnapshot();
|
||||
expect(wrapper.find('HostsTable')).toMatchSnapshot();
|
||||
});
|
||||
|
||||
describe('Sorting on Table', () => {
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import { getOr } from 'lodash/fp';
|
||||
import React from 'react';
|
||||
|
||||
|
@ -45,7 +44,7 @@ describe('Uncommon Process Table Component', () => {
|
|||
</TestProviders>
|
||||
);
|
||||
|
||||
expect(toJson(wrapper.find('UncommonProcessTable'))).toMatchSnapshot();
|
||||
expect(wrapper.find('UncommonProcessTable')).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it has a double dash (empty value) without any hosts at all', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
import { ActionCreator } from 'typescript-fsa';
|
||||
|
||||
|
@ -52,7 +51,7 @@ describe('IP Overview Component', () => {
|
|||
</TestProviders>
|
||||
);
|
||||
|
||||
expect(toJson(wrapper.find('IpOverview'))).toMatchSnapshot();
|
||||
expect(wrapper.find('IpOverview')).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
import { Provider as ReduxStoreProvider } from 'react-redux';
|
||||
|
||||
|
@ -42,7 +41,7 @@ describe('KpiNetwork Component', () => {
|
|||
</ReduxStoreProvider>
|
||||
);
|
||||
|
||||
expect(toJson(wrapper.find('KpiNetworkComponent'))).toMatchSnapshot();
|
||||
expect(wrapper.find('KpiNetworkComponent')).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it renders the default widget', () => {
|
||||
|
@ -59,7 +58,7 @@ describe('KpiNetwork Component', () => {
|
|||
</ReduxStoreProvider>
|
||||
);
|
||||
|
||||
expect(toJson(wrapper.find('KpiNetworkComponent'))).toMatchSnapshot();
|
||||
expect(wrapper.find('KpiNetworkComponent')).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import { getOr } from 'lodash/fp';
|
||||
import React from 'react';
|
||||
import { MockedProvider } from 'react-apollo/test-utils';
|
||||
|
@ -50,7 +49,7 @@ describe('NetworkTopNFlow Table Component', () => {
|
|||
</ReduxStoreProvider>
|
||||
);
|
||||
|
||||
expect(toJson(wrapper.find('Connect(NetworkDnsTableComponent)'))).toMatchSnapshot();
|
||||
expect(wrapper.find('Connect(NetworkDnsTableComponent)')).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { mount, shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
|
||||
import { FlowDirection } from '../../../../graphql/types';
|
||||
|
@ -19,7 +18,7 @@ describe('NetworkTopNFlow Select direction', () => {
|
|||
test('it renders the basic switch to include PTR in table', () => {
|
||||
const wrapper = shallow(<IsPtrIncluded isPtrIncluded={true} onChange={mockOnChange} />);
|
||||
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import { getOr } from 'lodash/fp';
|
||||
import React from 'react';
|
||||
import { MockedProvider } from 'react-apollo/test-utils';
|
||||
|
@ -51,7 +50,7 @@ describe('NetworkHttp Table Component', () => {
|
|||
</ReduxStoreProvider>
|
||||
);
|
||||
|
||||
expect(toJson(wrapper.find('Connect(NetworkHttpTableComponent)'))).toMatchSnapshot();
|
||||
expect(wrapper.find('Connect(NetworkHttpTableComponent)')).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import { getOr } from 'lodash/fp';
|
||||
import React from 'react';
|
||||
import { MockedProvider } from 'react-apollo/test-utils';
|
||||
|
@ -59,7 +58,7 @@ describe('NetworkTopCountries Table Component', () => {
|
|||
</ReduxStoreProvider>
|
||||
);
|
||||
|
||||
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', () => {
|
|||
</ReduxStoreProvider>
|
||||
);
|
||||
|
||||
expect(toJson(wrapper.find('Connect(NetworkTopCountriesTableComponent)'))).toMatchSnapshot();
|
||||
expect(wrapper.find('Connect(NetworkTopCountriesTableComponent)')).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import { getOr } from 'lodash/fp';
|
||||
import React from 'react';
|
||||
import { MockedProvider } from 'react-apollo/test-utils';
|
||||
|
@ -59,7 +58,7 @@ describe('NetworkTopNFlow Table Component', () => {
|
|||
</ReduxStoreProvider>
|
||||
);
|
||||
|
||||
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', () => {
|
|||
</ReduxStoreProvider>
|
||||
);
|
||||
|
||||
expect(toJson(wrapper.find('Connect(NetworkTopNFlowTableComponent)'))).toMatchSnapshot();
|
||||
expect(wrapper.find('Connect(NetworkTopNFlowTableComponent)')).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import { getOr } from 'lodash/fp';
|
||||
import React from 'react';
|
||||
import { MockedProvider } from 'react-apollo/test-utils';
|
||||
|
@ -47,7 +46,7 @@ describe('Tls Table Component', () => {
|
|||
</ReduxStoreProvider>
|
||||
);
|
||||
|
||||
expect(toJson(wrapper.find('Connect(TlsTableComponent)'))).toMatchSnapshot();
|
||||
expect(wrapper.find('Connect(TlsTableComponent)')).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import { getOr } from 'lodash/fp';
|
||||
import React from 'react';
|
||||
import { MockedProvider } from 'react-apollo/test-utils';
|
||||
|
@ -55,7 +54,7 @@ describe('Users Table Component', () => {
|
|||
</ReduxStoreProvider>
|
||||
);
|
||||
|
||||
expect(toJson(wrapper.find('Connect(UsersTableComponent)'))).toMatchSnapshot();
|
||||
expect(wrapper.find('Connect(UsersTableComponent)')).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
|
||||
import { OverviewHostStats } from '.';
|
||||
|
@ -15,7 +14,7 @@ describe('Overview Host Stat Data', () => {
|
|||
describe('rendering', () => {
|
||||
test('it renders the default OverviewHostStats', () => {
|
||||
const wrapper = shallow(<OverviewHostStats data={mockData.OverviewHost} loading={false} />);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
describe('loading', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
|
||||
import { OverviewNetworkStats } from '.';
|
||||
|
@ -17,7 +16,7 @@ describe('Overview Network Stat Data', () => {
|
|||
const wrapper = shallow(
|
||||
<OverviewNetworkStats data={mockData.OverviewNetwork} loading={false} />
|
||||
);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
describe('loading', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { mount, shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
|
||||
import { Direction } from '../../graphql/types';
|
||||
|
@ -58,7 +57,7 @@ describe('Paginated Table Component', () => {
|
|||
</ThemeProvider>
|
||||
);
|
||||
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it renders the loading panel at the beginning ', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
|
||||
import { TestProviders } from '../../mock/test_providers';
|
||||
|
@ -20,7 +19,7 @@ describe('Port', () => {
|
|||
const wrapper = shallow(
|
||||
<Port contextId="test" eventId="abcd" fieldName="destination.port" value="443" />
|
||||
);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it renders the port', () => {
|
||||
|
|
|
@ -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', () => {
|
|||
</ProgressInline>
|
||||
);
|
||||
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { mount, shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
|
||||
import { TestProviders } from '../../mock/test_providers';
|
||||
|
@ -107,7 +106,7 @@ describe('Resizeable', () => {
|
|||
/>
|
||||
);
|
||||
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
describe('resize cursor styling', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { mount, shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
|
||||
import { SelectableText } from '.';
|
||||
|
@ -13,7 +12,7 @@ import { SelectableText } from '.';
|
|||
describe('SelectableText', () => {
|
||||
test('renders correctly against snapshot', () => {
|
||||
const wrapper = shallow(<SelectableText>{'You may select this text'}</SelectableText>);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it applies the user-select: text style', () => {
|
||||
|
|
|
@ -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(<SkeletonRow />);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it renders the correct number of cells if cellCount is specified', () => {
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
import numeral from '@elastic/numeral';
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import { get } from 'lodash/fp';
|
||||
import React from 'react';
|
||||
|
||||
|
@ -101,7 +100,7 @@ describe('SourceDestination', () => {
|
|||
|
||||
test('renders correctly against snapshot', () => {
|
||||
const wrapper = shallow(<div>{getSourceDestinationInstance()}</div>);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it renders a destination label', () => {
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
|
||||
import euiDarkVars from '@elastic/eui/dist/eui_theme_dark.json';
|
||||
import { mount, ReactWrapper } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
import { ThemeProvider } from 'styled-components';
|
||||
|
||||
|
@ -93,7 +92,7 @@ describe('Stat Items Component', () => {
|
|||
],
|
||||
])('disable charts', wrapper => {
|
||||
test('it renders the default widget', () => {
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('should render titles', () => {
|
||||
|
@ -182,7 +181,7 @@ describe('Stat Items Component', () => {
|
|||
);
|
||||
});
|
||||
test('it renders the default widget', () => {
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('should handle multiple titles', () => {
|
||||
|
|
|
@ -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(<Subtitle items="Test subtitle" />);
|
||||
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it renders one subtitle string item', () => {
|
||||
|
|
|
@ -12,7 +12,6 @@ import {
|
|||
} from './helpers';
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import { TestProviders } from '../../mock';
|
||||
import { getEmptyValue } from '../empty_value';
|
||||
import { useMountAppended } from '../../utils/use_mount_appended';
|
||||
|
@ -29,7 +28,7 @@ describe('Table Helpers', () => {
|
|||
idPrefix: 'idPrefix',
|
||||
});
|
||||
const wrapper = shallow(<TestProviders>{rowItem}</TestProviders>);
|
||||
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(<TestProviders>{rowItems}</TestProviders>);
|
||||
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(<div>{rowItemOverflow}</div>);
|
||||
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(
|
||||
<OverflowFieldComponent value={overflowString} showToolTip={false} />
|
||||
);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it does not truncates as per custom overflowLength value', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { mount, shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
|
||||
import { ColumnHeaderType } from '../column_header';
|
||||
|
@ -24,7 +23,7 @@ describe('Filter', () => {
|
|||
};
|
||||
|
||||
const wrapper = shallow(<Filter header={textFilterColumnHeader} />);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
describe('rendering', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { mount, shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
|
||||
import { Direction } from '../../../../../graphql/types';
|
||||
|
@ -40,7 +39,7 @@ describe('Header', () => {
|
|||
timelineId={timelineId}
|
||||
/>
|
||||
);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
describe('rendering', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { mount, shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import { cloneDeep } from 'lodash/fp';
|
||||
import React from 'react';
|
||||
|
||||
|
@ -89,6 +88,6 @@ describe('HeaderToolTipContent', () => {
|
|||
test('it renders the expected table content', () => {
|
||||
const wrapper = shallow(<HeaderToolTipContent header={header} />);
|
||||
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
|
||||
import { DEFAULT_ACTIONS_COLUMN_WIDTH } from '../helpers';
|
||||
|
@ -54,7 +53,7 @@ describe('ColumnHeaders', () => {
|
|||
toggleColumn={jest.fn()}
|
||||
/>
|
||||
);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it renders the field browser', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { mount, shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
|
||||
import { DEFAULT_PLACEHOLDER, TextFilter } from '.';
|
||||
|
@ -14,7 +13,7 @@ describe('TextFilter', () => {
|
|||
describe('rendering', () => {
|
||||
test('renders correctly against snapshot', () => {
|
||||
const wrapper = shallow(<TextFilter columnId="foo" minWidth={100} />);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
describe('placeholder', () => {
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
|
||||
import React from 'react';
|
||||
|
||||
|
@ -29,6 +28,6 @@ describe('Columns', () => {
|
|||
/>
|
||||
);
|
||||
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
|
||||
import { useMountAppended } from '../../../../utils/use_mount_appended';
|
||||
|
@ -25,7 +24,7 @@ describe('Args', () => {
|
|||
processTitle="process-title-1"
|
||||
/>
|
||||
);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it returns an empty string when both args and process title are undefined', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
|
||||
import { BrowserFields } from '../../../../../containers/source';
|
||||
|
@ -30,7 +29,7 @@ describe('GenericDetails', () => {
|
|||
timelineId="test"
|
||||
/>
|
||||
);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it returns auditd if the data does contain auditd data', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
|
||||
import { BrowserFields } from '../../../../../containers/source';
|
||||
|
@ -31,7 +30,7 @@ describe('GenericFileDetails', () => {
|
|||
timelineId="test"
|
||||
/>
|
||||
);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it returns auditd if the data does contain auditd data', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import { cloneDeep } from 'lodash/fp';
|
||||
import React from 'react';
|
||||
|
||||
|
@ -46,7 +45,7 @@ describe('GenericRowRenderer', () => {
|
|||
});
|
||||
|
||||
const wrapper = shallow(<span>{children}</span>);
|
||||
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(<span>{children}</span>);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('should return false if not a auditd datum', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
|
||||
import { TestProviders } from '../../../../../mock';
|
||||
|
@ -26,7 +25,7 @@ describe('UserPrimarySecondary', () => {
|
|||
secondary="secondary-1"
|
||||
/>
|
||||
);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('should render user name only if that is all that is present', () => {
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
import { EuiFlexItem } from '@elastic/eui';
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import React from 'react';
|
||||
|
||||
import { TestProviders } from '../../../../../mock';
|
||||
|
@ -32,7 +31,7 @@ describe('SessionUserHostWorkingDir', () => {
|
|||
/>
|
||||
</EuiFlexItem>
|
||||
);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it renders with just eventId and contextId', () => {
|
||||
|
|
|
@ -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(<span>{emptyColumn}</span>);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('should return isInstance true if source is empty', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import { get } from 'lodash/fp';
|
||||
import React from 'react';
|
||||
|
||||
|
@ -33,7 +32,7 @@ describe('Events', () => {
|
|||
/>
|
||||
</TestProviders>
|
||||
);
|
||||
expect(toJson(wrapper.find('FormattedFieldValue'))).toMatchSnapshot();
|
||||
expect(wrapper.find('FormattedFieldValue')).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('it renders a localized date tooltip for a field type of date that has a valid timestamp', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import { cloneDeep } from 'lodash/fp';
|
||||
import React from 'react';
|
||||
|
||||
|
@ -41,7 +40,7 @@ describe('get_column_renderer', () => {
|
|||
});
|
||||
|
||||
const wrapper = shallow(<span>{column}</span>);
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('should render event severity when dealing with data that is not suricata', () => {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue