I-Bibliothek bin mit NGRX und dieserNGRX Effektgerät Test mulitple Aktionen in mergemap
einen Effekt wie@Effect()
loadCollection$: Observable<Action> = this.actions$
.ofType(authAction.GET_USER)
.startWith(new authAction.GetUserAction()) // call on app load
.switchMap(() =>
this.service.getUser()
.mergeMap((user: User) => [
new authAction.GetUserCompleteAction(user),
new navigationAction.GetLinksCompleteAction(user.role)
])
);
I-Spezifikation für sie schreibe und es sieht aus wie dieses
actions = new ReplaySubject(2);
actions.next(new auth.GetUserAction());
effects.loadCollection$.subscribe(result => {
expect(service.getUser).toHaveBeenCalled();
expect(result).toEqual(new navigation.GetLinksCompleteAction('test')); --> this line fails
});
Wie kann ich erwartet, dass mehrere Aktionen in der Zusammenführungskarte aufgerufen wurden.