diff --git a/tests/10apidoc/33room-members.pl b/tests/10apidoc/33room-members.pl index db4e86067..12339f002 100644 --- a/tests/10apidoc/33room-members.pl +++ b/tests/10apidoc/33room-members.pl @@ -512,6 +512,11 @@ =head2 room_fixture C<$user_fixture> should be a Fixture which will provide a User when provisioned. +C can contain a boolean key called C, which determines whether to +perform a user /sync request after creating the room. This involves inserting +and checking for a 'm.room.test' event in the room state, which may be +undesirable in some cases. Defaults to 1. + Any other options are passed into C, whence they are passed on to the server. @@ -531,7 +536,16 @@ sub room_fixture setup => sub { my ( $user ) = @_; - matrix_create_room( $user, %args )->then( sub { + # Determine whether to create room synced or not. Default is synced + # + # This will insert a m.room.test event into room state which + # some tests may not want + my $sync = 1; + if ( exists( $args{synced} ) && $args{synced} == 0 ) { + $sync = 0; + } + + ( $sync ? matrix_create_room_synced( $user, %args ) : matrix_create_room( $user, %args ) )->then( sub { my ( $room_id ) = @_; # matrix_create_room returns the room_id and the room_alias if # one was set. However we only want to return the room_id diff --git a/tests/30rooms/01state.pl b/tests/30rooms/01state.pl index 9e8f8c13c..f07b16bb9 100644 --- a/tests/30rooms/01state.pl +++ b/tests/30rooms/01state.pl @@ -263,7 +263,9 @@ sub set_test_state } test "Setting state twice is idempotent", - requires => [ local_user_and_room_fixtures() ], + # Setting synced to 1 inserts a m.room.test object into the + # timeline which this test does not expect + requires => [ local_user_and_room_fixtures( room_opts => { synced => 0 } ) ], check => sub { my ( $user, $room_id ) = @_; diff --git a/tests/50federation/33room-get-missing-events.pl b/tests/50federation/33room-get-missing-events.pl index 2156b4cd2..589f2b8d1 100644 --- a/tests/50federation/33room-get-missing-events.pl +++ b/tests/50federation/33room-get-missing-events.pl @@ -105,7 +105,9 @@ foreach my $vis (qw( world_readable shared invite joined )) { test "Inbound federation can return missing events for $vis visibility", requires => [ $main::OUTBOUND_CLIENT, - local_user_and_room_fixtures(), + # Setting synced to 1 inserts a m.room.test object into the + # timeline which this test does not expect + local_user_and_room_fixtures( room_opts => { synced => 0 } ), federation_user_id_fixture() ], do => sub {