Fix tests for Matrix v1.1 requirement (#25898)

This commit is contained in:
Michael Telatynski 2023-08-14 09:07:43 +01:00 committed by GitHub
parent d1f7b0898a
commit 7351c722be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 8 deletions

View file

@ -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;

View file

@ -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": {