Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug][Security Solution][Investigations] - Remove DataProvider from bottom bar #140727

Merged
merged 5 commits into from
Sep 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

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