fix(e2e): fix dragSourceBefore and toggleManagedCategory selectors

- dragSourceBefore: replace mat-list-item with .playlist-item as the
  drag target; playlist-item.component has no mat-list-item element,
  the inner container div carries the .playlist-item class
- toggleManagedCategory: match categories by name only instead of
  name+itemCount; after an Xtream refresh the itemCounts Map passed to
  the dialog may be empty (streams not yet counted), causing a false
  mismatch even though the category is present and uniquely named

https://claude.ai/code/session_01VU6ZZTG7YrhKhKBQvBfmpp
This commit is contained in:
Claude committed 2026-03-31 07:25:47 +00:00
1 parent ef344f4ee8
commit 3f08aba550
2 files changed
+2 -2

No files matched your search

@@ -170,7 +170,7 @@ async function toggleManagedCategory(
(await categoryRow.locator('.item-count').textContent())?.trim() ?? ''; (await categoryRow.locator('.item-count').textContent())?.trim() ?? '';
const itemCount = Number.parseInt(countText.replace(/[()]/g, ''), 10) || 0; const itemCount = Number.parseInt(countText.replace(/[()]/g, ''), 10) || 0;
if (name !== targetCategory.name || itemCount !== targetCategory.itemCount) { if (name !== targetCategory.name) {
continue; continue;
} }
@@ -707,7 +707,7 @@ export async function dragSourceBefore(
targetTitle: string targetTitle: string
): Promise<void> { ): Promise<void> {
const source = sourceRowByTitle(page, sourceTitle).locator('.drag-icon'); const source = sourceRowByTitle(page, sourceTitle).locator('.drag-icon');
const target = sourceRowByTitle(page, targetTitle).locator('mat-list-item'); const target = sourceRowByTitle(page, targetTitle).locator('.playlist-item');
await expect(source.first()).toBeVisible(); await expect(source.first()).toBeVisible();
await expect(target.first()).toBeVisible(); await expect(target.first()).toBeVisible();