@@ -742,7 +742,7 @@ describe('useEffectEvent', () => {
742
742
await act ( ( ) =>
743
743
ReactNoop . render ( < ChatRoom roomId = "general" theme = "light" /> ) ,
744
744
) ;
745
- await act ( ( ) => jest . runAllTimers ( ) ) ;
745
+
746
746
assertLog ( [ 'Welcome to the general room!' , 'Connected! theme: light' ] ) ;
747
747
expect ( ReactNoop ) . toMatchRenderedOutput (
748
748
< span prop = "Welcome to the general room!" /> ,
@@ -752,20 +752,17 @@ describe('useEffectEvent', () => {
752
752
await act ( ( ) =>
753
753
ReactNoop . render ( < ChatRoom roomId = "music" theme = "light" /> ) ,
754
754
) ;
755
- await act ( ( ) => jest . runAllTimers ( ) ) ;
756
755
assertLog ( [
757
756
'Welcome to the music room!' ,
758
757
// should trigger a reconnect
759
758
'Connected! theme: light' ,
760
759
] ) ;
761
-
762
760
expect ( ReactNoop ) . toMatchRenderedOutput (
763
761
< span prop = "Welcome to the music room!" /> ,
764
762
) ;
765
763
766
764
// change theme only
767
765
await act ( ( ) => ReactNoop . render ( < ChatRoom roomId = "music" theme = "dark" /> ) ) ;
768
- await act ( ( ) => jest . runAllTimers ( ) ) ;
769
766
// should not trigger a reconnect
770
767
assertLog ( [ 'Welcome to the music room!' ] ) ;
771
768
expect ( ReactNoop ) . toMatchRenderedOutput (
@@ -776,7 +773,6 @@ describe('useEffectEvent', () => {
776
773
await act ( ( ) =>
777
774
ReactNoop . render ( < ChatRoom roomId = "travel" theme = "dark" /> ) ,
778
775
) ;
779
- await act ( ( ) => jest . runAllTimers ( ) ) ;
780
776
assertLog ( [
781
777
'Welcome to the travel room!' ,
782
778
// should trigger a reconnect
0 commit comments