Created
June 30, 2021 17:12
-
-
Save pchab/254f316821b13de7b93ddbffa5d9c7d6 to your computer and use it in GitHub Desktop.
validation code saga marble test part 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it("throttle events for multiple users in 5 second frames", () => { | |
const payload = generatePayload(); | |
const secondPayload = generatePayload(); | |
testScheduler.run(({ hot, expectObservable }) => { | |
const events$ = hot("-uvu-vu- 5s --vuuv-|", { | |
u: new ValidationCodeGeneratedEvent(payload), | |
v: new ValidationCodeGeneratedEvent(secondPayload), | |
}); | |
const saga = new ValidationCodeSagas(); | |
const output$ = saga.ValidationCodeRequested(events$); | |
expectObservable(output$).toBe("-st----- 5s --ts---|", { | |
s: new SendValidationCodeCommand(payload), | |
t: new SendValidationCodeCommand(secondPayload), | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment