Skip to content

Commit

Permalink
Fix flaky test (closes #2984) (#3011)
Browse files Browse the repository at this point in the history
This seems to be more reliable based on triggering a few CI runs. However, I do not understand why that would be the case and have not been able to reproduce the issue consistently, so we'll see…
  • Loading branch information
tillprochaska authored and stchris committed May 3, 2023
1 parent 279ea34 commit 654cb90
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions ui/src/components/Timeline/TimelineItemCreateForm.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import crypto from 'node:crypto';
import { render, screen } from 'testUtils';
import { render, screen, waitFor } from 'testUtils';
import userEvent from '@testing-library/user-event';
import { Model, Entity, defaultModel } from '@alephdata/followthemoney';
import TimelineItemCreateForm from './TimelineItemCreateForm';
Expand Down Expand Up @@ -77,11 +77,10 @@ it('loads entity suggestions for source and target fields', async () => {
);

await selectSchema('Ownership');
await userEvent.click(screen.getByRole('button', { name: 'Owner' }));

const suggestion = await screen.findByRole('menuitem', {
name: 'ACME, Inc.',
});
await waitFor(() => expect(fetchEntitySuggestions).toHaveBeenCalledTimes(2));
await userEvent.click(screen.getByRole('button', { name: 'Owner' }));
const suggestion = screen.getByRole('menuitem', { name: 'ACME, Inc.' });
expect(suggestion).toBeInTheDocument();
});

Expand Down

0 comments on commit 654cb90

Please sign in to comment.