Skip to content

Commit

Permalink
Add back the helper function
Browse files Browse the repository at this point in the history
  • Loading branch information
reivilibre committed Nov 14, 2022
1 parent 94bdb1a commit a3755c6
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/10apidoc/36room-levels.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Tests migrated to Complement as of https://github.com/matrix-org/complement/pull/545
# However this helper function is used in other tests.

push our @EXPORT, qw( matrix_change_room_power_levels );

sub matrix_change_room_power_levels
{
my ( $user, $room_id, $func ) = @_;
is_User( $user ) or croak "Expected a User; got $user";

matrix_get_room_state( $user, $room_id, type => "m.room.power_levels" )
->then( sub {
my ( $levels ) = @_;
$func->( $levels );

matrix_put_room_state_synced( $user, $room_id, type => "m.room.power_levels",
content => $levels,
);
});
}

0 comments on commit a3755c6

Please sign in to comment.