Start here. This is the direct spoken answer to practice first.
Overview
A timing-sensitive test should control time and completion order instead of hoping real timers finish in the expected sequence.
I use virtual time or the test framework's fake timers for debounce and delay behavior rather than adding real sleeps. I feed the stream explicit inputs and assert which outputs occur at each meaningful boundary. For cancellation, I make an older request complete after a newer one and prove the old result cannot update the state.