From 31aaf92ca04286b5af07df1af73935d49138c3b3 Mon Sep 17 00:00:00 2001 From: Janki Salvi <117571355+js-jankisalvi@users.noreply.github.com> Date: Mon, 11 Mar 2024 10:26:25 +0100 Subject: [PATCH] Unskip flaky tests --- .../all_cases/columns_popover.test.tsx | 3 +-- .../all_cases/severity_filter.test.tsx | 3 +-- .../all_cases/status_filter.test.tsx | 3 +-- .../components/suggest_users_popover.test.tsx | 4 +--- .../category/category_form_field.test.tsx | 12 +--------- .../resilient/use_get_incident_types.test.tsx | 3 +-- .../create/flyout/create_case_flyout.test.tsx | 6 +---- .../components/create/form_context.test.tsx | 22 +++++++++++-------- .../components/custom_fields/index.test.tsx | 3 +-- .../custom_fields/toggle/edit.test.tsx | 3 +-- .../edit_connector/push_button.test.tsx | 4 +--- .../components/files/file_type.test.tsx | 3 +-- .../alert_property_actions.test.tsx | 3 +-- ...ered_attachments_property_actions.test.tsx | 3 +-- .../user_comment_property_actions.test.tsx | 3 +-- 15 files changed, 27 insertions(+), 51 deletions(-) diff --git a/x-pack/plugins/cases/public/components/all_cases/columns_popover.test.tsx b/x-pack/plugins/cases/public/components/all_cases/columns_popover.test.tsx index 4d6eb887c86d5..27f94319ecbcf 100644 --- a/x-pack/plugins/cases/public/components/all_cases/columns_popover.test.tsx +++ b/x-pack/plugins/cases/public/components/all_cases/columns_popover.test.tsx @@ -14,8 +14,7 @@ import type { AppMockRenderer } from '../../common/mock'; import { createAppMockRenderer } from '../../common/mock'; import { ColumnsPopover } from './columns_popover'; -// FLAKY: https://github.com/elastic/kibana/issues/174682 -describe.skip('ColumnsPopover', () => { +describe('ColumnsPopover', () => { let appMockRenderer: AppMockRenderer; beforeEach(() => { diff --git a/x-pack/plugins/cases/public/components/all_cases/severity_filter.test.tsx b/x-pack/plugins/cases/public/components/all_cases/severity_filter.test.tsx index 66b808dca5591..ca09d53501e5f 100644 --- a/x-pack/plugins/cases/public/components/all_cases/severity_filter.test.tsx +++ b/x-pack/plugins/cases/public/components/all_cases/severity_filter.test.tsx @@ -14,8 +14,7 @@ import { screen, waitFor } from '@testing-library/react'; import { waitForEuiPopoverOpen } from '@elastic/eui/lib/test/rtl'; import { SeverityFilter } from './severity_filter'; -// FLAKY: https://github.com/elastic/kibana/issues/176336 -describe.skip('Severity form field', () => { +describe('Severity form field', () => { const onChange = jest.fn(); let appMockRender: AppMockRenderer; const props = { diff --git a/x-pack/plugins/cases/public/components/all_cases/status_filter.test.tsx b/x-pack/plugins/cases/public/components/all_cases/status_filter.test.tsx index 66e8eca5b0784..3dac9d201ced4 100644 --- a/x-pack/plugins/cases/public/components/all_cases/status_filter.test.tsx +++ b/x-pack/plugins/cases/public/components/all_cases/status_filter.test.tsx @@ -19,8 +19,7 @@ const LABELS = { inProgress: i18n.STATUS_IN_PROGRESS, }; -// FLAKY: https://github.com/elastic/kibana/issues/177334 -describe.skip('StatusFilter', () => { +describe('StatusFilter', () => { const onChange = jest.fn(); const defaultProps = { selectedOptionKeys: [], diff --git a/x-pack/plugins/cases/public/components/case_view/components/suggest_users_popover.test.tsx b/x-pack/plugins/cases/public/components/case_view/components/suggest_users_popover.test.tsx index d84675d8e7883..479b8e39d232d 100644 --- a/x-pack/plugins/cases/public/components/case_view/components/suggest_users_popover.test.tsx +++ b/x-pack/plugins/cases/public/components/case_view/components/suggest_users_popover.test.tsx @@ -18,9 +18,7 @@ import type { AssigneeWithProfile } from '../../user_profiles/types'; jest.mock('../../../containers/user_profiles/api'); -// FLAKY: https://github.com/elastic/kibana/issues/171600 -// FLAKY: https://github.com/elastic/kibana/issues/171601 -describe.skip('SuggestUsersPopover', () => { +describe('SuggestUsersPopover', () => { let appMockRender: AppMockRenderer; let defaultProps: SuggestUsersPopoverProps; diff --git a/x-pack/plugins/cases/public/components/category/category_form_field.test.tsx b/x-pack/plugins/cases/public/components/category/category_form_field.test.tsx index d656bdf499eb0..cdaae6f49c5cc 100644 --- a/x-pack/plugins/cases/public/components/category/category_form_field.test.tsx +++ b/x-pack/plugins/cases/public/components/category/category_form_field.test.tsx @@ -16,17 +16,7 @@ import { categories } from '../../containers/mock'; import { MAX_CATEGORY_LENGTH } from '../../../common/constants'; import { FormTestComponent } from '../../common/test_utils'; -// FLAKY: https://github.com/elastic/kibana/issues/177791 -// FLAKY: https://github.com/elastic/kibana/issues/177792 -// FLAKY: https://github.com/elastic/kibana/issues/177793 -// FLAKY: https://github.com/elastic/kibana/issues/177794 -// FLAKY: https://github.com/elastic/kibana/issues/177795 -// FLAKY: https://github.com/elastic/kibana/issues/177796 -// FLAKY: https://github.com/elastic/kibana/issues/171605 -// FLAKY: https://github.com/elastic/kibana/issues/171606 -// FLAKY: https://github.com/elastic/kibana/issues/171607 -// FLAKY: https://github.com/elastic/kibana/issues/171608 -describe.skip('Category', () => { +describe('Category', () => { let appMockRender: AppMockRenderer; const onSubmit = jest.fn(); diff --git a/x-pack/plugins/cases/public/components/connectors/resilient/use_get_incident_types.test.tsx b/x-pack/plugins/cases/public/components/connectors/resilient/use_get_incident_types.test.tsx index 6430c1b1ff2fe..4d7183d9985f5 100644 --- a/x-pack/plugins/cases/public/components/connectors/resilient/use_get_incident_types.test.tsx +++ b/x-pack/plugins/cases/public/components/connectors/resilient/use_get_incident_types.test.tsx @@ -19,8 +19,7 @@ jest.mock('./api'); const useKibanaMock = useKibana as jest.Mocked; -// FLAKY: https://github.com/elastic/kibana/issues/178119 -describe.skip('useGetIncidentTypes', () => { +describe('useGetIncidentTypes', () => { const { http } = useKibanaMock().services; let appMockRender: AppMockRenderer; diff --git a/x-pack/plugins/cases/public/components/create/flyout/create_case_flyout.test.tsx b/x-pack/plugins/cases/public/components/create/flyout/create_case_flyout.test.tsx index 90129b373cf7c..ae41ae9ac2648 100644 --- a/x-pack/plugins/cases/public/components/create/flyout/create_case_flyout.test.tsx +++ b/x-pack/plugins/cases/public/components/create/flyout/create_case_flyout.test.tsx @@ -39,11 +39,7 @@ const defaultProps = { owner: 'securitySolution', }; -// FLAKY: https://github.com/elastic/kibana/issues/174525 -// FLAKY: https://github.com/elastic/kibana/issues/174526 -// FLAKY: https://github.com/elastic/kibana/issues/174527 -// FLAKY: https://github.com/elastic/kibana/issues/174528 -describe.skip('CreateCaseFlyout', () => { +describe('CreateCaseFlyout', () => { let appMockRenderer: AppMockRenderer; beforeEach(() => { diff --git a/x-pack/plugins/cases/public/components/create/form_context.test.tsx b/x-pack/plugins/cases/public/components/create/form_context.test.tsx index 9b23b46b18e31..7be30aea3d8ea 100644 --- a/x-pack/plugins/cases/public/components/create/form_context.test.tsx +++ b/x-pack/plugins/cases/public/components/create/form_context.test.tsx @@ -149,8 +149,7 @@ const waitForFormToRender = async (renderer: Screen) => { }); }; -// Failing: See https://github.com/elastic/kibana/issues/146394 -describe.skip('Create case', () => { +describe('Create case', () => { const refetch = jest.fn(); const onFormSubmitSuccess = jest.fn(); const afterCaseCreated = jest.fn(); @@ -466,18 +465,20 @@ describe.skip('Create case', () => { const textField = customFieldsConfigurationMock[0]; const toggleField = customFieldsConfigurationMock[1]; - expect(screen.getByTestId('create-case-custom-fields')).toBeInTheDocument(); + expect(await screen.findByTestId('create-case-custom-fields')).toBeInTheDocument(); - userEvent.paste( - screen.getByTestId(`${textField.key}-${textField.type}-create-custom-field`), - 'My text test value 1' + const textCustomFieldEle = await screen.findByTestId( + `${textField.key}-${textField.type}-create-custom-field` ); + userEvent.clear(textCustomFieldEle); + userEvent.paste(textCustomFieldEle, 'My text test value 1!!'); + userEvent.click( - screen.getByTestId(`${toggleField.key}-${toggleField.type}-create-custom-field`) + await screen.findByTestId(`${toggleField.key}-${toggleField.type}-create-custom-field`) ); - userEvent.click(screen.getByTestId('create-case-submit')); + userEvent.click(await screen.findByTestId('create-case-submit')); await waitFor(() => expect(postCase).toHaveBeenCalled()); @@ -485,7 +486,10 @@ describe.skip('Create case', () => { request: { ...sampleDataWithoutTags, customFields: [ - ...customFieldsMock, + { ...customFieldsMock[0], value: 'My text test value 1!!' }, + { ...customFieldsMock[1], value: false }, + { ...customFieldsMock[2] }, + { ...customFieldsMock[3], value: false }, { key: 'my_custom_field_key', type: CustomFieldTypes.TEXT, diff --git a/x-pack/plugins/cases/public/components/custom_fields/index.test.tsx b/x-pack/plugins/cases/public/components/custom_fields/index.test.tsx index 4da76d846dd9d..15a280716c3c0 100644 --- a/x-pack/plugins/cases/public/components/custom_fields/index.test.tsx +++ b/x-pack/plugins/cases/public/components/custom_fields/index.test.tsx @@ -17,8 +17,7 @@ import { MAX_CUSTOM_FIELDS_PER_CASE } from '../../../common/constants'; import { CustomFields } from '.'; import * as i18n from './translations'; -// FLAKY: https://github.com/elastic/kibana/issues/176805 -describe.skip('CustomFields', () => { +describe('CustomFields', () => { let appMockRender: AppMockRenderer; const props = { diff --git a/x-pack/plugins/cases/public/components/custom_fields/toggle/edit.test.tsx b/x-pack/plugins/cases/public/components/custom_fields/toggle/edit.test.tsx index 84f9547436bd0..1af31cf13dd54 100644 --- a/x-pack/plugins/cases/public/components/custom_fields/toggle/edit.test.tsx +++ b/x-pack/plugins/cases/public/components/custom_fields/toggle/edit.test.tsx @@ -14,8 +14,7 @@ import { customFieldsMock, customFieldsConfigurationMock } from '../../../contai import userEvent from '@testing-library/user-event'; import type { CaseCustomFieldToggle } from '../../../../common/types/domain'; -// FLAKY: https://github.com/elastic/kibana/issues/175112 -describe.skip('Edit ', () => { +describe('Edit ', () => { const onSubmit = jest.fn(); beforeEach(() => { diff --git a/x-pack/plugins/cases/public/components/edit_connector/push_button.test.tsx b/x-pack/plugins/cases/public/components/edit_connector/push_button.test.tsx index d53931d789627..fee6fdc8d1557 100644 --- a/x-pack/plugins/cases/public/components/edit_connector/push_button.test.tsx +++ b/x-pack/plugins/cases/public/components/edit_connector/push_button.test.tsx @@ -25,9 +25,7 @@ const defaultProps = { pushToService, }; -// FLAKY: https://github.com/elastic/kibana/issues/176671 -// FLAKY: https://github.com/elastic/kibana/issues/176672 -describe.skip('PushButton ', () => { +describe('PushButton ', () => { let appMockRender: AppMockRenderer; beforeEach(() => { diff --git a/x-pack/plugins/cases/public/components/files/file_type.test.tsx b/x-pack/plugins/cases/public/components/files/file_type.test.tsx index d9c58fd6cab2e..6a96870f14cf9 100644 --- a/x-pack/plugins/cases/public/components/files/file_type.test.tsx +++ b/x-pack/plugins/cases/public/components/files/file_type.test.tsx @@ -17,8 +17,7 @@ import { basicCase, basicFileMock } from '../../containers/mock'; import { getFileType } from './file_type'; import { FILE_ATTACHMENT_TYPE } from '../../../common/constants'; -// Failing: See https://github.com/elastic/kibana/issues/175841 -describe.skip('getFileType', () => { +describe('getFileType', () => { const fileType = getFileType(); it('invalid props return blank FileAttachmentViewObject', () => { diff --git a/x-pack/plugins/cases/public/components/user_actions/property_actions/alert_property_actions.test.tsx b/x-pack/plugins/cases/public/components/user_actions/property_actions/alert_property_actions.test.tsx index 64dfa08944ea1..ac2d1d245b56b 100644 --- a/x-pack/plugins/cases/public/components/user_actions/property_actions/alert_property_actions.test.tsx +++ b/x-pack/plugins/cases/public/components/user_actions/property_actions/alert_property_actions.test.tsx @@ -17,8 +17,7 @@ import { } from '../../../common/mock'; import { AlertPropertyActions } from './alert_property_actions'; -// FLAKY: https://github.com/elastic/kibana/issues/174667 -describe.skip('AlertPropertyActions', () => { +describe('AlertPropertyActions', () => { let appMock: AppMockRenderer; const props = { diff --git a/x-pack/plugins/cases/public/components/user_actions/property_actions/registered_attachments_property_actions.test.tsx b/x-pack/plugins/cases/public/components/user_actions/property_actions/registered_attachments_property_actions.test.tsx index 680139573a13a..f0db59b3a682d 100644 --- a/x-pack/plugins/cases/public/components/user_actions/property_actions/registered_attachments_property_actions.test.tsx +++ b/x-pack/plugins/cases/public/components/user_actions/property_actions/registered_attachments_property_actions.test.tsx @@ -18,8 +18,7 @@ import { import { RegisteredAttachmentsPropertyActions } from './registered_attachments_property_actions'; import { AttachmentActionType } from '../../../client/attachment_framework/types'; -// FLAKY: https://github.com/elastic/kibana/issues/174384 -describe.skip('RegisteredAttachmentsPropertyActions', () => { +describe('RegisteredAttachmentsPropertyActions', () => { let appMock: AppMockRenderer; const props = { diff --git a/x-pack/plugins/cases/public/components/user_actions/property_actions/user_comment_property_actions.test.tsx b/x-pack/plugins/cases/public/components/user_actions/property_actions/user_comment_property_actions.test.tsx index c24d26fa3b283..8fc3b0cb8adcb 100644 --- a/x-pack/plugins/cases/public/components/user_actions/property_actions/user_comment_property_actions.test.tsx +++ b/x-pack/plugins/cases/public/components/user_actions/property_actions/user_comment_property_actions.test.tsx @@ -17,8 +17,7 @@ import { import { UserCommentPropertyActions } from './user_comment_property_actions'; import { waitFor } from '@testing-library/react'; -// FLAKY: https://github.com/elastic/kibana/issues/175310 -describe.skip('UserCommentPropertyActions', () => { +describe('UserCommentPropertyActions', () => { let appMock: AppMockRenderer; const props = {