From 847062004f58f18dc442a4bcf05ddf37bde29c74 Mon Sep 17 00:00:00 2001 From: Johannes Millan Date: Sun, 18 Jan 2026 12:22:20 +0100 Subject: [PATCH] test(focus-mode): fix updateBanner$ effect tests by dispatching trigger actions The updateBanner$ effect is action-based and requires a triggering action to emit. Tests were subscribing directly without dispatching an action, causing timeouts in the LA timezone test run. Added tick() action dispatch to properly trigger the effect in all four failing tests. --- .../focus-mode/store/focus-mode.effects.spec.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/app/features/focus-mode/store/focus-mode.effects.spec.ts b/src/app/features/focus-mode/store/focus-mode.effects.spec.ts index 392078d29..5a1a8264e 100644 --- a/src/app/features/focus-mode/store/focus-mode.effects.spec.ts +++ b/src/app/features/focus-mode/store/focus-mode.effects.spec.ts @@ -3364,8 +3364,8 @@ describe('FocusModeEffects', () => { store.overrideSelector(selectIsFocusModeEnabled, true); store.refreshState(); - // Re-inject effects after setting up selectors - effects = TestBed.inject(FocusModeEffects); + // Dispatch a tick action to trigger the effect + actions$ = of(actions.tick()); // Subscribe to the effect to trigger it effects.updateBanner$.pipe(take(1)).subscribe(() => { @@ -3396,7 +3396,8 @@ describe('FocusModeEffects', () => { store.overrideSelector(selectIsFocusModeEnabled, true); store.refreshState(); - effects = TestBed.inject(FocusModeEffects); + // Dispatch a tick action to trigger the effect + actions$ = of(actions.tick()); effects.updateBanner$.pipe(take(1)).subscribe(() => { expect(bannerServiceMock.open).toHaveBeenCalled(); @@ -3425,7 +3426,8 @@ describe('FocusModeEffects', () => { store.overrideSelector(selectIsFocusModeEnabled, true); store.refreshState(); - effects = TestBed.inject(FocusModeEffects); + // Dispatch a tick action to trigger the effect + actions$ = of(actions.tick()); effects.updateBanner$.pipe(take(1)).subscribe(() => { expect(bannerServiceMock.open).toHaveBeenCalled(); @@ -3456,7 +3458,8 @@ describe('FocusModeEffects', () => { store.overrideSelector(selectIsFocusModeEnabled, true); store.refreshState(); - effects = TestBed.inject(FocusModeEffects); + // Dispatch a tick action to trigger the effect + actions$ = of(actions.tick()); effects.updateBanner$.pipe(take(1)).subscribe(() => { expect(bannerServiceMock.open).toHaveBeenCalled();