mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-01-23 02:36:05 +00:00
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.
This commit is contained in:
parent
4bbe7634d8
commit
847062004f
1 changed files with 8 additions and 5 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue