plugins: rtl 13 fixes for tests

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-10-13 13:11:15 +02:00
parent 0935b0d60f
commit 80a79cc1e7
27 changed files with 371 additions and 403 deletions
@@ -15,7 +15,7 @@
*/
import { MockConfigApi, TestApiProvider } from '@backstage/test-utils';
import { screen, render, waitFor, within } from '@testing-library/react';
import { screen, render, waitFor, within, act } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import React from 'react';
@@ -364,7 +364,7 @@ describe('SearchFilter.Autocomplete', () => {
});
// Blur the field and only one tag should be shown with a +1.
input.blur();
await act(() => userEvent.tab());
expect(
screen.queryByRole('button', { name: values[0] }),
).not.toBeInTheDocument();