multiple: fix act errors in the tests

This also helps reduce noise in the test output.
This commit is contained in:
Gianluca Zuccarelli 2025-06-18 16:51:39 +01:00 committed by Klara Simickova
parent c2998306cf
commit 78bb1e118b
3 changed files with 5 additions and 3 deletions

View file

@ -65,7 +65,7 @@ describe('Blueprints', () => {
}) })
); );
const { router } = await renderCustomRoutesWithReduxRouter(); const view = renderCustomRoutesWithReduxRouter();
await screen.findByText('No blueprints yet'); await screen.findByText('No blueprints yet');
const emptyStateAction = screen.getByRole('link', { const emptyStateAction = screen.getByRole('link', {
name: /Add blueprint/i, name: /Add blueprint/i,
@ -73,6 +73,8 @@ describe('Blueprints', () => {
expect(emptyStateAction).toBeInTheDocument(); expect(emptyStateAction).toBeInTheDocument();
user.click(emptyStateAction); user.click(emptyStateAction);
const { router } = await view;
await waitFor(() => await waitFor(() =>
expect(router.state.location.pathname).toBe( expect(router.state.location.pathname).toBe(
'/insights/image-builder/imagewizard' '/insights/image-builder/imagewizard'

View file

@ -104,7 +104,7 @@ const addSatelliteRegistrationCommandViaKeyDown = async (command: string) => {
await waitFor(() => user.clear(satelliteRegistrationCommand)); await waitFor(() => user.clear(satelliteRegistrationCommand));
await waitFor(() => user.type(satelliteRegistrationCommand, command)); await waitFor(() => user.type(satelliteRegistrationCommand, command));
satelliteRegistrationCommand.blur(); await waitFor(() => satelliteRegistrationCommand.blur());
}; };
const uploadFile = async (scriptName: string): Promise<void> => { const uploadFile = async (scriptName: string): Promise<void> => {

View file

@ -15,7 +15,7 @@ describe('Images Table', () => {
const user = userEvent.setup(); const user = userEvent.setup();
test('render ImagesTable', async () => { test('render ImagesTable', async () => {
await renderCustomRoutesWithReduxRouter(); renderCustomRoutesWithReduxRouter();
const table = await screen.findByTestId('images-table'); const table = await screen.findByTestId('images-table');