feat(playlist): show desktop health indicators for network sources (#1592)

This commit is contained in:
4gray authored and GitHub committed 2026-09-12 23:05:17 +02:00
1 parent a417826b01
commit 62655a8b5d
67 files changed
+2302 -60

No files matched your search

@@ -1594,6 +1594,12 @@ export async function openSourceEditor(
const dialog = page.locator('mat-dialog-container').last();
await expect(dialog).toBeVisible();
// Material applies its initial focus after the opening transition.
await dialog.evaluate(async (element) => {
await Promise.all(element.getAnimations({ subtree: true }).map((animation) =>
animation.finished.catch(() => undefined)
));
});
return dialog;
}
+27 -4
View File
@@ -91,7 +91,7 @@ test.describe('Electron Sources View', () => {
await dialog
.getByRole('button', { name: 'Add', exact: true })
.click();
await page.waitForURL(/xtreams.*vod/);
await waitForXtreamCatalog(page);
await openSources(page);
dialog = await openSourceEditor(page, title);
await dialog.locator('[formControlName="password"]').fill('');
@@ -170,7 +170,7 @@ test.describe('Electron Sources View', () => {
);
expect(saved?.serverUrl).toBe(liveFormatMock);
await refreshSource(page, title, { confirm: true });
await waitForSourceRowIdle(page, title);
await waitForXtreamCatalog(page);
const refreshed = await waitForPortalDebugEvent(page, {
provider: 'xtream',
operation: 'get_live_streams',
@@ -532,6 +532,17 @@ https://streams.example.test/url-omega.m3u8
});
await openSources(app.mainWindow);
await expect(
sourceRowByTitle(app.mainWindow, 'Delete Me Stalker').locator(
'app-source-health-indicator [data-state]'
)
).toHaveAttribute('data-state', 'active', { timeout: 20000 });
await expect(
sourceRowByTitle(app.mainWindow, 'Delete Me Xtream').locator(
'app-source-health-indicator [data-state]'
)
).toHaveAttribute('data-state', 'active', { timeout: 20000 });
await deleteSource(app.mainWindow, deletableLocalSourceDisplayName);
await expect(
sourceRowByTitle(
@@ -660,14 +671,26 @@ https://streams.example.test/original-url.m3u8
https://streams.example.test/refreshed-url.m3u8
`
);
// A previous refresh toast must not satisfy this operation's completion.
await expect(
app.mainWindow.locator('.mat-mdc-snack-bar-label')
).toHaveCount(0);
await refreshSource(app.mainWindow, 'refresh-url-source.m3u');
await expectPlaylistUpdatedToast(app.mainWindow);
await waitForSourceRowIdle(
app.mainWindow,
'refresh-url-source.m3u'
);
await sourceRowByTitle(app.mainWindow, 'refresh-url-source.m3u')
.first()
const refreshedUrlRow = sourceRowByTitle(
app.mainWindow,
'refresh-url-source.m3u'
).first();
await expect(
refreshedUrlRow.locator('.playlist-item')
).not.toHaveClass(/is-busy/);
await expect(refreshedUrlRow.locator('.refresh-btn')).toBeEnabled();
await refreshedUrlRow
.getByText('refresh-url-source.m3u', { exact: true })
.click();
await waitForM3uCatalog(app.mainWindow);
await expect(