From 7351c722be69afb48c7e6f270cd1a3b1812ab202 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 14 Aug 2023 09:07:43 +0100 Subject: [PATCH] Fix tests for Matrix v1.1 requirement (#25898) --- test/app-tests/loading-test.tsx | 12 +++++------- test/app-tests/server-config-test.ts | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/test/app-tests/loading-test.tsx b/test/app-tests/loading-test.tsx index aacdb5da4b..58d6583ea2 100644 --- a/test/app-tests/loading-test.tsx +++ b/test/app-tests/loading-test.tsx @@ -158,10 +158,8 @@ describe("loading:", function () { async function expectAndAwaitSync(opts?: { isGuest?: boolean }): Promise { 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; diff --git a/test/app-tests/server-config-test.ts b/test/app-tests/server-config-test.ts index 22b8304458..b469daf28d 100644 --- a/test/app-tests/server-config-test.ts +++ b/test/app-tests/server-config-test.ts @@ -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": {