[Cases] Fix failing test: useCreateCaseModal (#181386)

Fixes #174205

## Summary

The failing test was rendering the opened modal and not doing anything
with it. I removed that block and the execution time locally went from
200+ ms to around 4.
This commit is contained in:
Antonio 2024-04-24 13:43:58 +02:00 committed by GitHub
parent 910e7f7252
commit e2c39c93ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -7,7 +7,6 @@
import React from 'react';
import { renderHook, act } from '@testing-library/react-hooks';
import { render, act as reactAct } from '@testing-library/react';
import { useKibana } from '../../common/lib/kibana';
import type { UseCreateCaseModalProps, UseCreateCaseModalReturnedValues } from '.';
@ -19,8 +18,7 @@ jest.mock('../../common/lib/kibana');
const useKibanaMock = useKibana as jest.Mocked<typeof useKibana>;
const onCaseCreated = jest.fn();
// FLAKY: https://github.com/elastic/kibana/issues/174205
describe.skip('useCreateCaseModal', () => {
describe('useCreateCaseModal', () => {
let navigateToApp: jest.Mock;
beforeEach(() => {
@ -95,14 +93,6 @@ describe.skip('useCreateCaseModal', () => {
act(() => {
result.current.openModal();
});
await reactAct(async () => {
const modal = result.current.modal;
render(<TestProviders>{modal}</TestProviders>);
});
act(() => {
result.current.modal.props.onSuccess({ id: 'case-id' });
});