kehrt ich einen Effekt haben, die Aktion gibt A, dann B AktionWie teste ich eine Wirkung, die mehrere Aktionen
@Effect() myEffect$: Observable <Action> = this.actions$
.ofType('MY_ACTION')
.switchMap(() => Observable.of(
// subscribers will be notified
{ type: 'ACTION_ONE' },
// subscribers will be notified (again ...)
{ type: 'ACTION_TWO' }
));
Wie kann ich die zwei aufeinanderfolgenden zurück Aktionen testen?
it('should return action one then action two',() => {
runner.queue(new myAction());
const expectedResult = twoSuccesiveActions;
sessionEffect.myEffect$.subscribe(result => {
// how do I test those two succesively returned actions
expect(result).toEqual(expectedResult);
});
});