[Cases] Fix registered attachments property actions flaky test (#174788)

## Summary

Fixes https://github.com/elastic/kibana/issues/174384

Successful runs:
https://buildkite.com/elastic/kibana-pull-request/builds?branch=cnasikas%3Afix_174384

### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Christos Nasikas 2024-01-15 14:34:50 +02:00 committed by GitHub
parent 8f078224aa
commit 72764f5c0f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 = {
@ -47,7 +46,7 @@ describe.skip('RegisteredAttachmentsPropertyActions', () => {
1
);
expect(screen.queryByTestId('property-actions-user-action-trash')).toBeInTheDocument();
expect(await screen.findByTestId('property-actions-user-action-trash')).toBeInTheDocument();
});
it('renders the modal info correctly', async () => {
@ -85,7 +84,7 @@ describe.skip('RegisteredAttachmentsPropertyActions', () => {
expect(await screen.findByTestId('property-actions-confirm-modal')).toBeInTheDocument();
userEvent.click(screen.getByText('Delete'));
userEvent.click(await screen.findByText('Delete'));
await waitFor(() => {
expect(props.onDelete).toHaveBeenCalled();