From ebfab57779b8f168bf0ca207c15b9284a9860ba3 Mon Sep 17 00:00:00 2001 From: 4gray Date: Sun, 6 Sep 2026 09:58:33 +0200 Subject: [PATCH] test(web-e2e): scope the Stalker radio rail toggles to the rail The workspace header now carries a second "Hide/Show channels list" toggle, so the role+name locators matched more than one button and tripped Playwright's strict mode. Target the rail's own chevron and the floating restore button, and assert the header toggle mirrors the state. Co-Authored-By: Claude Fable 5.1 --- apps/web-e2e/src/stalker.e2e.ts | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/apps/web-e2e/src/stalker.e2e.ts b/apps/web-e2e/src/stalker.e2e.ts index cf7b71fae..6b517833e 100644 --- a/apps/web-e2e/src/stalker.e2e.ts +++ b/apps/web-e2e/src/stalker.e2e.ts @@ -189,7 +189,9 @@ async function resetMockServer( for (let attempt = 0; attempt < 3; attempt += 1) { try { - const response = await request.post(`${MOCK_SERVER}/reset?${query}`); + const response = await request.post( + `${MOCK_SERVER}/reset?${query}` + ); if (response.ok()) { return; } @@ -550,13 +552,22 @@ test('@stalker radio — stations use the inline audio player without EPG', asyn timeout: 20_000, }); - await page.getByRole('button', { name: 'Hide channels list' }).click(); - const restoreButton = page.getByRole('button', { - name: 'Show channels list', - }); + // The rail's own chevron hides the list; the workspace header carries a + // second toggle with the same accessible name, so scope to the rail. + await page + .locator('.sidebar') + .getByRole('button', { name: 'Hide channels list' }) + .click(); + const restoreButton = page.locator('.sidebar-restore'); await expect(restoreButton).toBeVisible(); + await expect( + page.locator('app-workspace-shell-header .header-sidebar-toggle') + ).toHaveAttribute('aria-pressed', 'false'); await restoreButton.click(); await expect(stations.first()).toBeVisible(); + await expect( + page.locator('app-workspace-shell-header .header-sidebar-toggle') + ).toHaveAttribute('aria-pressed', 'true'); await expect(page.locator('app-epg-timeline')).toHaveCount(0); expect(epgRequests).toHaveLength(0); @@ -1183,9 +1194,7 @@ test('@stalker series watched toggle — embedded series marks and clears from t const menuTrigger = page.locator('[data-test-id="series-watch-menu"]'); await expect(menuTrigger).toBeVisible(); await menuTrigger.click(); - const seriesToggle = page.locator( - '[data-test-id="toggle-series-watched"]' - ); + const seriesToggle = page.locator('[data-test-id="toggle-series-watched"]'); await expect(seriesToggle).toBeVisible(); await expect(seriesToggle).toContainText( `Mark series as watched (${episodeCount})`