From 5b78a51daec1ab5fd76d805528874baa7ccadede Mon Sep 17 00:00:00 2001 From: 4gray Date: Tue, 6 Oct 2026 12:59:23 +0200 Subject: [PATCH] test(playback): let the overlay's signal write schedule its own render Review follow-up (Greptile): the test forced a render with fixture.detectChanges() after the debounce timer, so it would pass even if the signal write stopped scheduling an OnPush render. It now runs the fixture with autoDetectChanges and only advances the fake timers; with plain fields under OnPush the overlay never renders and the test fails. Co-Authored-By: Claude Opus 5.5 --- .../video-player.component.fullscreen-panel.spec.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/libs/playlist/m3u/feature-player/src/lib/video-player/video-player.component.fullscreen-panel.spec.ts b/libs/playlist/m3u/feature-player/src/lib/video-player/video-player.component.fullscreen-panel.spec.ts index 97805fe02..72af02b4e 100644 --- a/libs/playlist/m3u/feature-player/src/lib/video-player/video-player.component.fullscreen-panel.spec.ts +++ b/libs/playlist/m3u/feature-player/src/lib/video-player/video-player.component.fullscreen-panel.spec.ts @@ -252,20 +252,22 @@ describe('VideoPlayerComponent fullscreen channel panel + zapping', () => { }); // OnPush: the overlay hides from a 2 s timer, outside any template - // event, so it must leave the DOM without a zone-triggered tick. - it('hides the channel-number overlay when its debounce fires', () => { + // event, so the signal write itself must schedule the render. The test + // never forces one after the timer: a plain-field write would leave the + // overlay in the DOM. + it('hides the channel-number overlay when its debounce fires', async () => { jest.useFakeTimers(); try { const overlay = () => (fixture.nativeElement as HTMLElement).querySelector( '.channel-number-overlay' ); + fixture.autoDetectChanges(); component.handleChannelNumberInput('2'); - fixture.detectChanges(); + await jest.advanceTimersByTimeAsync(50); expect(overlay()?.textContent).toBe('2'); - jest.advanceTimersByTime(2000); - fixture.detectChanges(); + await jest.advanceTimersByTimeAsync(2000); expect(overlay()).toBeNull(); expect(storeMock.dispatch).toHaveBeenCalledWith(