mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-13 20:56:19 -08:00
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:
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();
|
||||
}
|
||||
Reference in new issue
Block a user