Skip to content

Commit

Permalink
[Bug][Security Solution][Investigations] - Remove DataProvider from b…
Browse files Browse the repository at this point in the history
…ottom bar (#140727)

* remove dataproviders from bottom bar

* remove unused dataprovider tests

* cleanup code

* fix tests

* rename boolean
  • Loading branch information
michaelolo24 committed Sep 16, 2022
1 parent 6932b71 commit a4ba3f8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 364 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -9,91 +9,36 @@ import React from 'react';
import { render, screen } from '@testing-library/react';

import { TestProviders } from '../../../../common/mock/test_providers';
import { TimelineTabs } from '../../../../../common/types/timeline';
import { FlyoutBottomBar } from '.';

describe('FlyoutBottomBar', () => {
test('it renders the expected bottom bar', () => {
render(
<TestProviders>
<FlyoutBottomBar
timelineId="test"
showDataproviders={true}
activeTab={TimelineTabs.query}
/>
<FlyoutBottomBar timelineId="test" showTimelineHeaderPanel={true} />
</TestProviders>
);

expect(screen.getByTestId('flyoutBottomBar')).toBeInTheDocument();
});

test('it renders the data providers drop target area', () => {
render(
<TestProviders>
<FlyoutBottomBar
timelineId="test"
showDataproviders={true}
activeTab={TimelineTabs.query}
/>
</TestProviders>
);

expect(screen.getByTestId('dataProviders')).toBeInTheDocument();
});

test('it renders the flyout header panel', () => {
render(
<TestProviders>
<FlyoutBottomBar
timelineId="test"
showDataproviders={true}
activeTab={TimelineTabs.query}
/>
<FlyoutBottomBar timelineId="test" showTimelineHeaderPanel={true} />
</TestProviders>
);

expect(screen.getByTestId('timeline-flyout-header-panel')).toBeInTheDocument();
});

test('it hides the data providers drop target area', () => {
render(
<TestProviders>
<FlyoutBottomBar
timelineId="test"
showDataproviders={false}
activeTab={TimelineTabs.query}
/>
</TestProviders>
);

expect(screen.queryByTestId('dataProviders')).not.toBeInTheDocument();
});

test('it hides the flyout header panel', () => {
render(
<TestProviders>
<FlyoutBottomBar
timelineId="test"
showDataproviders={false}
activeTab={TimelineTabs.query}
/>
<FlyoutBottomBar timelineId="test" showTimelineHeaderPanel={false} />
</TestProviders>
);

expect(screen.queryByTestId('timeline-flyout-header-panel')).not.toBeInTheDocument();
});

test('it renders the data providers drop target area when showDataproviders=false and tab is not query', () => {
render(
<TestProviders>
<FlyoutBottomBar
timelineId="test"
showDataproviders={false}
activeTab={TimelineTabs.notes}
/>
</TestProviders>
);

expect(screen.getByTestId('dataProviders')).toBeInTheDocument();
});
});
Loading

0 comments on commit a4ba3f8

Please sign in to comment.