@@ -453,7 +453,9 @@ def test_aggregation_must_be_annotation(self):
453453 )
454454 self .assertEquals (400 , channel .code , channel .json_body )
455455
456- @unittest .override_config ({"experimental_features" : {"msc3440_enabled" : True }})
456+ @unittest .override_config (
457+ {"experimental_features" : {"msc3440_enabled" : True , "msc3666_enabled" : True }}
458+ )
457459 def test_bundled_aggregations (self ):
458460 """
459461 Test that annotations, references, and threads get correctly bundled.
@@ -579,6 +581,23 @@ def assert_bundle(event_json: JsonDict) -> None:
579581 self .assertTrue (room_timeline ["limited" ])
580582 assert_bundle (self ._find_event_in_chunk (room_timeline ["events" ]))
581583
584+ # Request search.
585+ channel = self .make_request (
586+ "POST" ,
587+ "/search" ,
588+ # Search term matches the parent message.
589+ content = {"search_categories" : {"room_events" : {"search_term" : "Hi" }}},
590+ access_token = self .user_token ,
591+ )
592+ self .assertEquals (200 , channel .code , channel .json_body )
593+ chunk = [
594+ result ["result" ]
595+ for result in channel .json_body ["search_categories" ]["room_events" ][
596+ "results"
597+ ]
598+ ]
599+ assert_bundle (self ._find_event_in_chunk (chunk ))
600+
582601 def test_aggregation_get_event_for_annotation (self ):
583602 """Test that annotations do not get bundled aggregations included
584603 when directly requested.
@@ -759,6 +778,7 @@ def test_ignore_invalid_room(self):
759778 self .assertEquals (200 , channel .code , channel .json_body )
760779 self .assertNotIn ("m.relations" , channel .json_body ["unsigned" ])
761780
781+ @unittest .override_config ({"experimental_features" : {"msc3666_enabled" : True }})
762782 def test_edit (self ):
763783 """Test that a simple edit works."""
764784
@@ -825,6 +845,23 @@ def assert_bundle(event_json: JsonDict) -> None:
825845 self .assertTrue (room_timeline ["limited" ])
826846 assert_bundle (self ._find_event_in_chunk (room_timeline ["events" ]))
827847
848+ # Request search.
849+ channel = self .make_request (
850+ "POST" ,
851+ "/search" ,
852+ # Search term matches the parent message.
853+ content = {"search_categories" : {"room_events" : {"search_term" : "Hi" }}},
854+ access_token = self .user_token ,
855+ )
856+ self .assertEquals (200 , channel .code , channel .json_body )
857+ chunk = [
858+ result ["result" ]
859+ for result in channel .json_body ["search_categories" ]["room_events" ][
860+ "results"
861+ ]
862+ ]
863+ assert_bundle (self ._find_event_in_chunk (chunk ))
864+
828865 def test_multi_edit (self ):
829866 """Test that multiple edits, including attempts by people who
830867 shouldn't be allowed, are correctly handled.
0 commit comments