fix(e2e): wait for category-item list to render before interacting with manage-categories dialog

The dialog's 'Select All' button appears as soon as isLoading() flips,
but Angular still needs a change-detection cycle to paint the @for loop.
On slower CI runners (especially after a refreshSource cycle) the
.category-item rows were not yet in the DOM when toggleManagedCategory
tried to locate them, causing a spurious 5 s timeout.

Fix: add an explicit `toBeVisible` guard on the first .category-item
inside openManageCategoriesDialog, and raise the per-row timeout in
toggleManagedCategory from 5 s to 15 s.

https://claude.ai/code/session_01VU6ZZTG7YrhKhKBQvBfmpp
This commit is contained in:
Claude committed 2026-04-01 05:32:53 +00:00
1 parent ffa5b59a5c
commit df0c7f79d1
1 file changed
+6 -1
@@ -103,6 +103,11 @@ async function openManageCategoriesDialog(page: Page) {
await expect(
dialog.getByRole('button', { name: 'Select All', exact: true })
).toBeVisible();
// Wait for the category list to render — Angular needs a CD cycle after
// isLoading() flips to false before the @for items are painted.
await expect(dialog.locator('.category-item').first()).toBeVisible({
timeout: 15000,
});
return dialog;
}
@@ -167,6 +172,6 @@ async function toggleManagedCategory(
.filter({ hasText: targetCategory.name })
.first();
await expect(categoryRow).toBeVisible({ timeout: 5000 });
await expect(categoryRow).toBeVisible({ timeout: 15000 });
await categoryRow.click();
}