catalog: wait for async operation

Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
This commit is contained in:
Vincenzo Scamporlino
2023-10-20 15:53:34 +02:00
parent 4078bd73bb
commit 89748e3c2d
@@ -320,10 +320,9 @@ describe('DefaultCatalogPage', () => {
// Now that we've starred an entity, the "Starred" menu option should be
// enabled.
expect(screen.getByTestId('user-picker-starred')).not.toHaveAttribute(
'aria-disabled',
'true',
);
expect(
await screen.findByTestId('user-picker-starred'),
).not.toHaveAttribute('aria-disabled', 'true');
fireEvent.click(screen.getByTestId('user-picker-starred'));
await expect(
screen.findByText(/Starred components \(1\)/),