mirror of
https://github.com/element-hq/element-web
synced 2024-11-22 01:05:42 +03:00
Fix tests for Matrix v1.1 requirement (#25898)
This commit is contained in:
parent
d1f7b0898a
commit
7351c722be
2 changed files with 6 additions and 8 deletions
|
@ -158,10 +158,8 @@ describe("loading:", function () {
|
|||
async function expectAndAwaitSync(opts?: { isGuest?: boolean }): Promise<any> {
|
||||
let syncRequest: (typeof MockHttpBackend.prototype.requests)[number] | null = null;
|
||||
httpBackend.when("GET", "/_matrix/client/versions").respond(200, {
|
||||
versions: ["r0.3.0"],
|
||||
unstable_features: {
|
||||
"m.lazy_load_members": true,
|
||||
},
|
||||
versions: ["v1.1"],
|
||||
unstable_features: {},
|
||||
});
|
||||
const isGuest = opts?.isGuest;
|
||||
if (!isGuest) {
|
||||
|
@ -220,7 +218,7 @@ describe("loading:", function () {
|
|||
});
|
||||
|
||||
// Pass the liveliness checks
|
||||
httpBackend.when("GET", "/versions").respond(200, { versions: ["r0.4.0"] });
|
||||
httpBackend.when("GET", "/versions").respond(200, { versions: ["v1.1"] });
|
||||
httpBackend.when("GET", "/_matrix/identity/v2").respond(200, {});
|
||||
|
||||
return sleep(1)
|
||||
|
@ -270,7 +268,7 @@ describe("loading:", function () {
|
|||
});
|
||||
|
||||
// Pass the liveliness checks
|
||||
httpBackend.when("GET", "/versions").respond(200, { versions: ["r0.4.0"] });
|
||||
httpBackend.when("GET", "/versions").respond(200, { versions: ["v1.1"] });
|
||||
httpBackend.when("GET", "/_matrix/identity/v2").respond(200, {});
|
||||
|
||||
return awaitLoginComponent(matrixChat)
|
||||
|
@ -283,7 +281,7 @@ describe("loading:", function () {
|
|||
// the only outstanding request should be a GET /login
|
||||
// (in particular there should be no /register request for
|
||||
// guest registration).
|
||||
const allowedRequests = ["/_matrix/client/r0/login", "/versions", "/_matrix/identity/v2"];
|
||||
const allowedRequests = ["/_matrix/client/v3/login", "/versions", "/_matrix/identity/v2"];
|
||||
for (const req of httpBackend.requests) {
|
||||
if (req.method === "GET" && allowedRequests.find((p) => req.path.endsWith(p))) {
|
||||
continue;
|
||||
|
|
|
@ -29,7 +29,7 @@ describe("Loading server config", function () {
|
|||
PlatformPeg.set(new WebPlatform());
|
||||
fetchMock.get("https://matrix-client.matrix.org/_matrix/client/versions", {
|
||||
unstable_features: {},
|
||||
versions: [],
|
||||
versions: ["v1.1"],
|
||||
});
|
||||
fetchMock.get("https://matrix.org/.well-known/matrix/client", {
|
||||
"m.homeserver": {
|
||||
|
|
Loading…
Reference in a new issue