From fdcb47d140a12fa146015d4b3c89deca2eb58b35 Mon Sep 17 00:00:00 2001 From: 4gray Date: Tue, 6 Oct 2026 22:21:43 +0200 Subject: [PATCH] test(portal): let the favorites handler's markForCheck render the heart Review follow-up (Greptile): the test forced detectChanges() after the favorites arrived, so it passed without the handler's markForCheck(). It now lets the fixture render on its own; removing the call fails it. Co-Authored-By: Claude Opus 5.5 --- .../portal-channels-list.component.spec.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/portal/xtream/feature/src/lib/portal-channels-list/portal-channels-list.component.spec.ts b/libs/portal/xtream/feature/src/lib/portal-channels-list/portal-channels-list.component.spec.ts index c964079b2..a05a42348 100644 --- a/libs/portal/xtream/feature/src/lib/portal-channels-list/portal-channels-list.component.spec.ts +++ b/libs/portal/xtream/feature/src/lib/portal-channels-list/portal-channels-list.component.spec.ts @@ -931,6 +931,9 @@ describe('PortalChannelsListComponent', () => { .componentInstance as ChannelListItemComponent; expect(row().isFavorite()).toBe(false); + // From here the fixture renders on its own: a forced detectChanges() + // would hide a favorites handler that does not mark the view. + fixture.autoDetectChanges(); favorites$.next([ { content_id: 1, @@ -941,7 +944,8 @@ describe('PortalChannelsListComponent', () => { xtream_id: 50, }, ] satisfies FavoriteItem[]); - fixture.detectChanges(); + await fixture.whenStable(); + await new Promise((resolve) => setTimeout(resolve)); expect(row().isFavorite()).toBe(true); });