@@ -674,6 +674,20 @@ describe('MessagePanel', function() {
674674
675675describe ( "shouldFormContinuation" , ( ) => {
676676 it ( "does not form continuations from thread roots" , ( ) => {
677+ const message1 = TestUtilsMatrix . mkMessage ( {
678+ event : true ,
679+ room : "!room:id" ,
680+ user : "@user:id" ,
681+ msg : "Here is a message in the main timeline" ,
682+ } ) ;
683+
684+ const message2 = TestUtilsMatrix . mkMessage ( {
685+ event : true ,
686+ room : "!room:id" ,
687+ user : "@user:id" ,
688+ msg : "And here's another message in the main timeline" ,
689+ } ) ;
690+
677691 const threadRoot = TestUtilsMatrix . mkMessage ( {
678692 event : true ,
679693 room : "!room:id" ,
@@ -682,14 +696,15 @@ describe("shouldFormContinuation", () => {
682696 } ) ;
683697 jest . spyOn ( threadRoot , "isThreadRoot" , "get" ) . mockReturnValue ( true ) ;
684698
685- const message = TestUtilsMatrix . mkMessage ( {
699+ const message3 = TestUtilsMatrix . mkMessage ( {
686700 event : true ,
687701 room : "!room:id" ,
688702 user : "@user:id" ,
689- msg : "And here's another message in the main timeline" ,
703+ msg : "And here's another message in the main timeline after the thread root " ,
690704 } ) ;
691705
692- expect ( shouldFormContinuation ( threadRoot , message , false , true ) ) . toEqual ( false ) ;
693- expect ( shouldFormContinuation ( message , threadRoot , false , true ) ) . toEqual ( true ) ;
706+ expect ( shouldFormContinuation ( message1 , message2 , false , true ) ) . toEqual ( true ) ;
707+ expect ( shouldFormContinuation ( message2 , threadRoot , false , true ) ) . toEqual ( false ) ;
708+ expect ( shouldFormContinuation ( threadRoot , message3 , false , true ) ) . toEqual ( false ) ;
694709 } ) ;
695710} ) ;
0 commit comments