File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
examples/todomvc-flux/js/dispatcher/__tests__ Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -24,10 +24,11 @@ describe('AppDispatcher', function() {
2424
2525 var listener1Done = false ;
2626 var listener1 = function ( pl ) {
27- return AppDispatcher . waitFor ( [ index2 ] , function ( ) {
28- // Second and third listeners should have now been called
27+ return AppDispatcher . waitFor ( [ index2 , index4 ] , function ( ) {
28+ // Second, third, and fourth listeners should have now been called
2929 expect ( listener2Done ) . toBe ( true ) ;
3030 expect ( listener3Done ) . toBe ( true ) ;
31+ expect ( listener4Done ) . toBe ( true ) ;
3132 listener1Done = true ;
3233 } ) ;
3334 } ;
@@ -49,6 +50,15 @@ describe('AppDispatcher', function() {
4950 } ;
5051 var index3 = AppDispatcher . register ( listener3 ) ;
5152
53+ var listener4Done = false ;
54+ var listener4 = function ( pl ) {
55+ return AppDispatcher . waitFor ( [ index3 ] , function ( ) {
56+ expect ( listener3Done ) . toBe ( true ) ;
57+ listener4Done = true ;
58+ } ) ;
59+ } ;
60+ var index4 = AppDispatcher . register ( listener4 ) ;
61+
5262 runs ( function ( ) {
5363 AppDispatcher . dispatch ( payload ) ;
5464 } ) ;
You can’t perform that action at this time.
0 commit comments