diff --git a/web/src/screens/channels/ChannelPreviewPanel.test.tsx b/web/src/screens/channels/ChannelPreviewPanel.test.tsx index f70455367..f05d5a903 100644 --- a/web/src/screens/channels/ChannelPreviewPanel.test.tsx +++ b/web/src/screens/channels/ChannelPreviewPanel.test.tsx @@ -287,6 +287,17 @@ describe('ChannelPreviewPanel', () => { expect(screen.queryByText(/networkError: manifestLoadError/)).not.toBeInTheDocument(); expect(hlsMock.loadSource).toHaveBeenLastCalledWith('/iptv/channel/34.1.m3u8'); + + // The failed-flag reset runs in an effect, not during render, so prove it actually ran: the + // new channel must still be able to reach `playing`. Without this assertion, deleting that + // reset leaves the suite green while the new channel sits at `starting` forever, because + // onPlaying would keep returning early on the PREVIOUS channel's stale failed flag. + const video = document.body.querySelector('video'); + act(() => { + video?.dispatchEvent(new Event('playing')); + }); + + expect(screen.getByText('playing')).toBeInTheDocument(); }); it('does not carry the retry play token over to the next channel', () => {