@@ -1937,6 +1937,15 @@ describe("Room", function() {
19371937 expect ( ( ) => room . createThread ( rootEvent . getId ( ) , rootEvent , [ ] ) ) . not . toThrow ( ) ;
19381938 } ) ;
19391939
1940+ it ( "creating thread from edited event should not conflate old versions of the event" , ( ) => {
1941+ const message = mkMessage ( ) ;
1942+ const edit = mkEdit ( message ) ;
1943+ message . makeReplaced ( edit ) ;
1944+
1945+ const thread = room . createThread ( "$000" , message , [ ] , true ) ;
1946+ expect ( thread ) . toHaveLength ( 0 ) ;
1947+ } ) ;
1948+
19401949 it ( "Edits update the lastReply event" , async ( ) => {
19411950 room . client . supportsExperimentalThreads = ( ) => true ;
19421951
@@ -2036,17 +2045,15 @@ describe("Room", function() {
20362045 } ,
20372046 } ) ;
20382047
2039- let prom = emitPromise ( room , ThreadEvent . New ) ;
2048+ const prom = emitPromise ( room , ThreadEvent . New ) ;
20402049 room . addLiveEvents ( [ threadRoot , threadResponse1 , threadResponse2 , threadResponse2Reaction ] ) ;
20412050 const thread = await prom ;
20422051
20432052 expect ( thread ) . toHaveLength ( 2 ) ;
20442053 expect ( thread . replyToEvent . getId ( ) ) . toBe ( threadResponse2 . getId ( ) ) ;
20452054
2046- prom = emitPromise ( thread , ThreadEvent . Update ) ;
20472055 const threadResponse2ReactionRedaction = mkRedaction ( threadResponse2Reaction ) ;
20482056 room . addLiveEvents ( [ threadResponse2ReactionRedaction ] ) ;
2049- await prom ;
20502057 expect ( thread ) . toHaveLength ( 2 ) ;
20512058 expect ( thread . replyToEvent . getId ( ) ) . toBe ( threadResponse2 . getId ( ) ) ;
20522059 } ) ;
0 commit comments