Add tests to cover joining and starting an Element call (#30843)

* Add tests

* Add test IDs

* Revert to pre-new-widget-refactors state

* Update codeowners

* Remove one of the test IDs

* Update snapshots as DMs don't have room names :)

* Remove only

* fix a import

* fix docstring

* update snaps

* remove a line

* update snaps
This commit is contained in:
Will Hunt
2025-09-23 13:38:18 +01:00
committed by GitHub
parent b89de61e12
commit 479b451916
8 changed files with 338 additions and 3 deletions

View File

@@ -469,6 +469,27 @@ export class Client {
);
}
/**
* Set a power level to one or multiple users.
* Will apply changes atop of current power level event.
* @param roomId - the room to update power levels in
* @param userId - the ID of the user or users to update power levels of
* @param powerLevel - the numeric power level to update given users to
*/
public async setPowerLevel(
roomId: string,
userId: string | string[],
powerLevel: number,
): Promise<ISendEventResponse> {
const client = await this.prepareClient();
return client.evaluate(
async (client, { roomId, userId, powerLevel }) => {
return client.setPowerLevel(roomId, userId, powerLevel);
},
{ roomId, userId, powerLevel },
);
}
/**
* Leaves the given room.
* @param roomId ID of the room to leave