ngrx and unit testing beginner here. I have the following effect:
@Injectable()
export class NotificationEffects {
@Effect({dispatch: false})
notificationShow$ = this.actions$
.ofType(notificationAction.NOTIFICATION_SHOW)
.do((action: notificationAction.NotificationShowAction) => {
this.notificationService.info(action.payload.config);
});
constructor(private actions$: Actions, private notificationService: NotificationService) {}
}
Specifically, I would like to test that the notificationService method info has been called. How would I do that?
I have followed these examples but not found a solution:
https://netbasal.com/unit-test-your-ngrx-effects-in-angular-1bf2142dd459 https://medium.com/@adrianfaciu/testing-ngrx-effects-3682cb5d760e https://github.com/ngrx/effects/blob/master/docs/testing.md