@@ -742,7 +742,7 @@ describe('useEffectEvent', () => {
742742await act ( ( ) =>
743743ReactNoop . render ( < ChatRoom roomId = "general" theme = "light" /> ) ,
744744) ;
745- await act ( ( ) => jest . runAllTimers ( ) ) ;
745+
746746assertLog ( [ 'Welcome to the general room!' , 'Connected! theme: light' ] ) ;
747747expect ( ReactNoop ) . toMatchRenderedOutput (
748748< span prop = "Welcome to the general room!" /> ,
@@ -752,20 +752,17 @@ describe('useEffectEvent', () => {
752752await act ( ( ) =>
753753ReactNoop . render ( < ChatRoom roomId = "music" theme = "light" /> ) ,
754754) ;
755- await act ( ( ) => jest . runAllTimers ( ) ) ;
756755assertLog ( [
757756'Welcome to the music room!' ,
758757// should trigger a reconnect
759758'Connected! theme: light' ,
760759] ) ;
761-
762760expect ( ReactNoop ) . toMatchRenderedOutput (
763761< span prop = "Welcome to the music room!" /> ,
764762) ;
765763
766764// change theme only
767765await act ( ( ) => ReactNoop . render ( < ChatRoom roomId = "music" theme = "dark" /> ) ) ;
768- await act ( ( ) => jest . runAllTimers ( ) ) ;
769766// should not trigger a reconnect
770767assertLog ( [ 'Welcome to the music room!' ] ) ;
771768expect ( ReactNoop ) . toMatchRenderedOutput (
@@ -776,7 +773,6 @@ describe('useEffectEvent', () => {
776773await act ( ( ) =>
777774ReactNoop . render ( < ChatRoom roomId = "travel" theme = "dark" /> ) ,
778775) ;
779- await act ( ( ) => jest . runAllTimers ( ) ) ;
780776assertLog ( [
781777'Welcome to the travel room!' ,
782778// should trigger a reconnect
0 commit comments