@@ -470,11 +470,24 @@ describe('SimpleEventPlugin', function() {
470470 'High-pri count: 7, Low-pri count: 0' ,
471471 ] ) ;
472472
473- // At the end, both counters should equal the total number of clicks
474- expect ( Scheduler ) . toFlushAndYield ( [
475- 'High-pri count: 8, Low-pri count: 0' ,
476- 'High-pri count: 8, Low-pri count: 8' ,
477- ] ) ;
473+ if ( gate ( flags => flags . enableDiscreteEventMicroTasks ) ) {
474+ // Flush the microtask queue
475+ await null ;
476+
477+ // At the end, both counters should equal the total number of clicks
478+ expect ( Scheduler ) . toHaveYielded ( [
479+ 'High-pri count: 8, Low-pri count: 0' ,
480+
481+ // TODO: with cancellation, this required another flush?
482+ 'High-pri count: 8, Low-pri count: 8' ,
483+ ] ) ;
484+ } else {
485+ // At the end, both counters should equal the total number of clicks
486+ expect ( Scheduler ) . toFlushAndYield ( [
487+ 'High-pri count: 8, Low-pri count: 0' ,
488+ 'High-pri count: 8, Low-pri count: 8' ,
489+ ] ) ;
490+ }
478491 expect ( button . textContent ) . toEqual ( 'High-pri count: 8, Low-pri count: 8' ) ;
479492 } ) ;
480493 } ) ;
0 commit comments