1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-07-28 15:22:05 +03:00

Move from browser-request to fetch (#9345)

This commit is contained in:
Michael Telatynski
2022-10-12 18:59:07 +01:00
committed by GitHub
parent ae883bb94b
commit 8b54be6f48
50 changed files with 1474 additions and 607 deletions

View File

@ -130,6 +130,20 @@ describe("createRoom", () => {
expect(callPower).toBe(100);
expect(callMemberPower).toBe(100);
});
it("should upload avatar if one is passed", async () => {
client.uploadContent.mockResolvedValue({ content_uri: "mxc://foobar" });
const avatar = new File([], "avatar.png");
await createRoom({ avatar });
expect(client.createRoom).toHaveBeenCalledWith(expect.objectContaining({
initial_state: expect.arrayContaining([{
content: {
url: "mxc://foobar",
},
type: "m.room.avatar",
}]),
}));
});
});
describe("canEncryptToAllUsers", () => {