plugins: rtl 13 fixes for tests
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -273,12 +273,12 @@ describe('Stepper', () => {
|
||||
/>,
|
||||
);
|
||||
|
||||
await act(async () => {
|
||||
await fireEvent.click(getByRole('button', { name: 'Review' }));
|
||||
|
||||
expect(getByRole('progressbar')).toBeInTheDocument();
|
||||
expect(getByRole('button', { name: 'Review' })).toBeDisabled();
|
||||
act(() => {
|
||||
fireEvent.click(getByRole('button', { name: 'Review' }));
|
||||
});
|
||||
|
||||
expect(getByRole('progressbar')).toBeInTheDocument();
|
||||
expect(getByRole('button', { name: 'Review' })).toBeDisabled();
|
||||
});
|
||||
|
||||
it('should transform default error message', async () => {
|
||||
|
||||
+2
-1
@@ -20,6 +20,7 @@ import { TemplateCategoryPicker } from './TemplateCategoryPicker';
|
||||
import { renderInTestApp, TestApiProvider } from '@backstage/test-utils';
|
||||
import { alertApiRef } from '@backstage/core-plugin-api';
|
||||
import { fireEvent } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
|
||||
jest.mock('@backstage/plugin-catalog-react', () => ({
|
||||
useEntityTypeFilter: jest.fn(),
|
||||
@@ -91,7 +92,7 @@ describe('TemplateCategoryPicker', () => {
|
||||
);
|
||||
|
||||
const openButton = getByRole('button', { name: 'Open' });
|
||||
openButton.click();
|
||||
await userEvent.click(openButton);
|
||||
|
||||
expect(getByRole('checkbox', { name: 'Foo' })).toBeInTheDocument();
|
||||
expect(getByRole('checkbox', { name: 'Bar' })).toBeInTheDocument();
|
||||
|
||||
Reference in New Issue
Block a user