test(import): wait for the URL without the store list

This commit is contained in:
lobo committed 2026-10-01 08:30:24 +02:00
1 parent f01ad03f6e
commit 43968b3b7a
1 file changed
+3 -2
+3 -2
View File
@@ -171,7 +171,8 @@ describe('ImportPage', () => {
expect(await screen.findByText('IMPORT.STORE_READ:2')).toBeTruthy(); expect(await screen.findByText('IMPORT.STORE_READ:2')).toBeTruthy();
expect(screen.getByText('Pokémon Scarlet · Switch')).toBeTruthy(); expect(screen.getByText('Pokémon Scarlet · Switch')).toBeTruthy();
expect(screen.getByLabelText('url').textContent).toBe('/import'); // The router takes the new URL in a later render than the rows.
await waitFor(() => expect(screen.getByLabelText('url').textContent).toBe('/import'));
fireEvent.click(screen.getByRole('button', {name: 'IMPORT.START'})); fireEvent.click(screen.getByRole('button', {name: 'IMPORT.START'}));
await screen.findByText('IMPORT.MATCHING'); await screen.findByText('IMPORT.MATCHING');
@@ -185,7 +186,7 @@ describe('ImportPage', () => {
renderPage({'GET ': json(200, {imports: []})}, '/import#data=broken'); renderPage({'GET ': json(200, {imports: []})}, '/import#data=broken');
await waitFor(() => expect(toast.error).toHaveBeenCalledWith('IMPORT.STORE_LIST_BROKEN')); await waitFor(() => expect(toast.error).toHaveBeenCalledWith('IMPORT.STORE_LIST_BROKEN'));
expect(screen.getByLabelText('url').textContent).toBe('/import'); await waitFor(() => expect(screen.getByLabelText('url').textContent).toBe('/import'));
expect(await screen.findByLabelText('IMPORT.TEXT_LABEL')).toBeTruthy(); expect(await screen.findByLabelText('IMPORT.TEXT_LABEL')).toBeTruthy();
}); });