Skip to content

Commit

Permalink
[8.x] [Security Solution] Investigations fixed unified components fla…
Browse files Browse the repository at this point in the history
…ky tests (#195231) (#195268)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Security Solution] Investifations fixed unified components flaky
tests (#195231)](#195231)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Jatin
Kathuria","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-07T14:13:27Z","message":"[Security
Solution] Investifations fixed unified components flaky tests
(#195231)\n\nFixes Flaky test Issues\r\n -
https://github.com/elastic/kibana/issues/189793\r\n -
https://github.com/elastic/kibana/issues/189792\r\n -
https://github.com/elastic/kibana/issues/189794","sha":"6b3bb66835a30422b48b3753be6feaa781a955a1","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Threat
Hunting:Investigations","backport:prev-minor"],"title":"[Security
Solution] Investifations fixed unified components flaky
tests","number":195231,"url":"https://github.com/elastic/kibana/pull/195231","mergeCommit":{"message":"[Security
Solution] Investifations fixed unified components flaky tests
(#195231)\n\nFixes Flaky test Issues\r\n -
https://github.com/elastic/kibana/issues/189793\r\n -
https://github.com/elastic/kibana/issues/189792\r\n -
https://github.com/elastic/kibana/issues/189794","sha":"6b3bb66835a30422b48b3753be6feaa781a955a1"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195231","number":195231,"mergeCommit":{"message":"[Security
Solution] Investifations fixed unified components flaky tests
(#195231)\n\nFixes Flaky test Issues\r\n -
https://github.com/elastic/kibana/issues/189793\r\n -
https://github.com/elastic/kibana/issues/189792\r\n -
https://github.com/elastic/kibana/issues/189794","sha":"6b3bb66835a30422b48b3753be6feaa781a955a1"}}]}]
BACKPORT-->

Co-authored-by: Jatin Kathuria <[email protected]>
  • Loading branch information
kibanamachine and logeekal authored Oct 7, 2024
1 parent 04c5679 commit b02d7ee
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 b02d7ee

Please sign in to comment.