Skip to content

Commit

Permalink
[Security Solution] Investifations fixed unified components flaky tes…
Browse files Browse the repository at this point in the history
…ts (elastic#195231)

Fixes Flaky test Issues
 - elastic#189793
 - elastic#189792
 - elastic#189794
  • Loading branch information
logeekal authored Oct 7, 2024
1 parent 78cc1ad commit 6b3bb66
Showing 1 changed file with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import * as timelineActions from '../../../../store/actions';
import { useExpandableFlyoutApi } from '@kbn/expandable-flyout';
import { createExpandableFlyoutApiMock } from '../../../../../common/mock/expandable_flyout';
import { OPEN_FLYOUT_BUTTON_TEST_ID } from '../../../../../notes/components/test_ids';
import { userEvent } from '@testing-library/user-event';

jest.mock('../../../../../common/components/user_privileges');

Expand Down Expand Up @@ -646,9 +647,7 @@ describe('query tab with unified timeline', () => {
);
});

// FLAKY: https://github.com/elastic/kibana/issues/189792
// FLAKY: https://github.com/elastic/kibana/issues/189793
describe.skip('left controls', () => {
describe('left controls', () => {
it(
'should clear all sorting',
async () => {
Expand All @@ -665,9 +664,9 @@ describe('query tab with unified timeline', () => {
// // timestamp sorting indicators
expect(
await screen.findByTestId('euiDataGridColumnSorting-sortColumn-@timestamp')
).toBeVisible();
).toBeInTheDocument();

expect(screen.getByTestId('dataGridHeaderCellSortingIcon-@timestamp')).toBeVisible();
expect(screen.getByTestId('dataGridHeaderCellSortingIcon-@timestamp')).toBeInTheDocument();

fireEvent.click(screen.getByTestId('dataGridColumnSortingClearButton'));

Expand All @@ -694,17 +693,17 @@ describe('query tab with unified timeline', () => {
// // timestamp sorting indicators
expect(
await screen.findByTestId('euiDataGridColumnSorting-sortColumn-@timestamp')
).toBeVisible();
).toBeInTheDocument();

expect(screen.getByTestId('dataGridHeaderCellSortingIcon-@timestamp')).toBeVisible();
expect(screen.getByTestId('dataGridHeaderCellSortingIcon-@timestamp')).toBeInTheDocument();

// add more columns to sorting
fireEvent.click(screen.getByText(/Pick fields to sort by/));

await waitFor(() => {
expect(
screen.getByTestId('dataGridColumnSortingPopoverColumnSelection-event.severity')
).toBeVisible();
).toBeInTheDocument();
});

fireEvent.click(
Expand All @@ -713,13 +712,15 @@ describe('query tab with unified timeline', () => {

// check new columns for sorting validity
await waitFor(() => {
expect(screen.getByTestId('dataGridHeaderCellSortingIcon-event.severity')).toBeVisible();
expect(
screen.getByTestId('dataGridHeaderCellSortingIcon-event.severity')
).toBeInTheDocument();
});
expect(
screen.getByTestId('euiDataGridColumnSorting-sortColumn-event.severity')
).toBeVisible();
).toBeInTheDocument();

expect(screen.getByTestId('dataGridHeaderCellSortingIcon-@timestamp')).toBeVisible();
expect(screen.getByTestId('dataGridHeaderCellSortingIcon-@timestamp')).toBeInTheDocument();
},
SPECIAL_TEST_TIMEOUT
);
Expand Down Expand Up @@ -885,8 +886,7 @@ describe('query tab with unified timeline', () => {
});

describe('Leading actions - notes', () => {
// FLAKY: https://github.com/elastic/kibana/issues/189794
describe.skip('securitySolutionNotesEnabled = true', () => {
describe('securitySolutionNotesEnabled = true', () => {
beforeEach(() => {
(useIsExperimentalFeatureEnabled as jest.Mock).mockImplementation(
jest.fn((feature: keyof ExperimentalFeatures) => {
Expand All @@ -912,10 +912,10 @@ describe('query tab with unified timeline', () => {

expect(screen.getByTestId('timeline-notes-notification-dot')).toBeVisible();

fireEvent.mouseOver(screen.getByTestId('timeline-notes-button-small'));
userEvent.hover(screen.getByTestId('timeline-notes-button-small'));

await waitFor(() => {
expect(screen.getByTestId('timeline-notes-tool-tip')).toBeVisible();
expect(screen.getByTestId('timeline-notes-tool-tip')).toBeInTheDocument();
expect(screen.getByTestId('timeline-notes-tool-tip')).toHaveTextContent(
'1 Note available. Click to view it & add more.'
);
Expand Down

0 comments on commit 6b3bb66

Please sign in to comment.