test(browser): poll the import review's rows instead of reading them once

gridOf reads the dialog's rows once; right after the click the review may
not have rendered them yet (firefox CI: received undefined).
This commit is contained in:
Vito Sansevero
2026-10-26 08:27:30 -07:00
parent 476b1f73dc
commit 19097ed6e1
@@ -381,7 +381,8 @@ test('saved pairs block the import: the review explains it and offers only Close
await openIntegrations(page);
await enable(page);
await layoutOf(page).getByRole('button', { name: 'Review import', exact: true }).click();
expect((await gridOf(page))[2]).toEqual(['Protected', '1 imported prompt used by saved pairs']);
// gridOf reads once; poll until the review has rendered its rows.
await expect.poll(async () => (await gridOf(page))[2]).toEqual(['Protected', '1 imported prompt used by saved pairs']);
await expect(dialog(page).locator('p.small')).toHaveText(
'Delete or change the saved pairs that use these prompts, then review the import again. Nothing was changed.');
expect(await dialog(page).locator('.dialog-actions button').allTextContents()).toEqual(['Close']);