1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-07-30 04:23:07 +03:00

Merge branch 'master' into develop

This commit is contained in:
RiotRobot
2022-10-25 17:05:28 +01:00
3 changed files with 55 additions and 3 deletions

View File

@ -1334,6 +1334,30 @@ describe("MatrixClient", function() {
expect(resp.token).toBe("tt");
});
});
describe("registerWithIdentityServer", () => {
it("should pass data to POST request", async () => {
const token = {
access_token: "access_token",
token_type: "Bearer",
matrix_server_name: "server_name",
expires_in: 12345,
};
httpBackend!.when("POST", "/account/register").check(req => {
expect(req.data).toStrictEqual(token);
}).respond(200, {
access_token: "at",
token: "tt",
});
const prom = client!.registerWithIdentityServer(token);
await httpBackend!.flushAllExpected();
const resp = await prom;
expect(resp.access_token).toBe("at");
expect(resp.token).toBe("tt");
});
});
});
function withThreadId(event: MatrixEvent, newThreadId: string): MatrixEvent {