You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-08-07 23:02:56 +03:00
Implementation of MSC3882 login token request (#2687)
This commit is contained in:
@@ -1075,6 +1075,29 @@ describe("MatrixClient", function() {
|
||||
expect(await prom).toStrictEqual(response);
|
||||
});
|
||||
});
|
||||
|
||||
describe("requestLoginToken", () => {
|
||||
it("should hit the expected API endpoint with UIA", async () => {
|
||||
const response = {};
|
||||
const uiaData = { foo: "baa" };
|
||||
const prom = client.requestLoginToken(uiaData);
|
||||
httpBackend
|
||||
.when("POST", "/unstable/org.matrix.msc3882/login/token", { auth: uiaData })
|
||||
.respond(200, response);
|
||||
await httpBackend.flush();
|
||||
expect(await prom).toStrictEqual(response);
|
||||
});
|
||||
|
||||
it("should hit the expected API endpoint without UIA", async () => {
|
||||
const response = {};
|
||||
const prom = client.requestLoginToken();
|
||||
httpBackend
|
||||
.when("POST", "/unstable/org.matrix.msc3882/login/token", {})
|
||||
.respond(200, response);
|
||||
await httpBackend.flush();
|
||||
expect(await prom).toStrictEqual(response);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function withThreadId(event, newThreadId) {
|
||||
|
Reference in New Issue
Block a user