test(stalker): cover radio playback surviving a category switch in web E2E (#1522)

The E2E added in #1517 proved the ITV case only. Radio shares the live
layout and the same context-panel handler, and its inline audio player is
gated on the store selection just like the ITV player, so a regression in
`onStalkerCategoryClicked` would silence a station the user never switched
away from. The new scenario mirrors the ITV one: play a station, pick
another category, wait for the sidebar title to change, and assert the
audio player is still mounted.

Closes #1521

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
4grayandClaude Fable 5.1 authored and GitHub committed 2026-09-03 22:27:15 +02:00
1 parent 70fff19977
commit 9455e0db65
1 file changed
+38
+38
View File
@@ -552,6 +552,44 @@ test('@stalker radio — stations use the inline audio player without EPG', asyn
expect(epgRequests).toHaveLength(0);
});
test('@stalker radio playback survives a category switch', async ({ page }) => {
// Radio shares the ITV layout and the same context-panel handler that
// used to clear the selected item on every category click (#1517). The
// inline audio player is gated on that selection, so a category switch
// silenced the station the user never switched away from.
await addStalkerPortal(page);
await page.getByRole('link', { name: /radio/i }).click();
await page.waitForURL(/stalker.*radio/);
const categories = page.locator('.category-item');
await expect(categories.nth(2)).toBeVisible({ timeout: 10_000 });
await categories.nth(1).click();
const sidebar = page.locator('app-stalker-live-stream-layout .sidebar');
const sidebarTitle = sidebar.locator('.category-title');
const stations = page.locator('[data-test-id="channel-item"]');
await expect(stations.first()).toBeVisible({ timeout: 20_000 });
const firstCategoryTitle = (await sidebarTitle.textContent())?.trim() ?? '';
expect(firstCategoryTitle).not.toBe('');
await stations.first().click();
await expect(stations.first()).toHaveClass(/active/, { timeout: 20_000 });
const audioPlayer = page.locator('app-audio-player');
await expect(audioPlayer).toBeVisible({ timeout: 20_000 });
await categories.nth(2).click();
// The sidebar re-filters to the new category (proves the click landed and
// change detection ran)…
await expect(sidebarTitle).not.toHaveText(firstCategoryTitle, {
timeout: 20_000,
});
await expect(stations.first()).toBeVisible({ timeout: 20_000 });
// …while the station picked from the previous category keeps playing.
await expect(audioPlayer).toBeVisible();
});
test('@stalker PWA skips bulk EPG across channel switches', async ({
page,
}) => {