You've already forked matrix-js-sdk
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:
@ -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 {
|
||||
|
Reference in New Issue
Block a user