Update tests not to mock out an ancient server (#26796)
The loading test, which mocks a `/versions` response, currently mocks the response of a 2-year-old server. This will soon be incompatible with the JS-SDK. Update the test in preparation.
This commit is contained in:
parent
2555ffc0d4
commit
258fc405db
3 changed files with 14 additions and 5 deletions
|
@ -39,6 +39,9 @@ import { cleanLocalstorage, deleteIndexedDB, waitForLoadingSpinner, waitForWelco
|
|||
const DEFAULT_HS_URL = "http://my_server";
|
||||
const DEFAULT_IS_URL = "http://my_is";
|
||||
|
||||
/** The matrix versions our mock server claims to support */
|
||||
const SERVER_SUPPORTED_MATRIX_VERSIONS = ["v1.1", "v1.5", "v1.6", "v1.8", "v1.9"];
|
||||
|
||||
describe("loading:", function () {
|
||||
let httpBackend: MockHttpBackend;
|
||||
|
||||
|
@ -155,7 +158,7 @@ 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: ["v1.1"],
|
||||
versions: SERVER_SUPPORTED_MATRIX_VERSIONS,
|
||||
unstable_features: {},
|
||||
});
|
||||
const isGuest = opts?.isGuest;
|
||||
|
@ -215,7 +218,7 @@ describe("loading:", function () {
|
|||
});
|
||||
|
||||
// Pass the liveliness checks
|
||||
httpBackend.when("GET", "/versions").respond(200, { versions: ["v1.1"] });
|
||||
httpBackend.when("GET", "/versions").respond(200, { versions: SERVER_SUPPORTED_MATRIX_VERSIONS });
|
||||
httpBackend.when("GET", "/_matrix/identity/v2").respond(200, {});
|
||||
|
||||
return sleep(1)
|
||||
|
@ -265,7 +268,7 @@ describe("loading:", function () {
|
|||
});
|
||||
|
||||
// Pass the liveliness checks
|
||||
httpBackend.when("GET", "/versions").respond(200, { versions: ["v1.1"] });
|
||||
httpBackend.when("GET", "/versions").respond(200, { versions: SERVER_SUPPORTED_MATRIX_VERSIONS });
|
||||
httpBackend.when("GET", "/_matrix/identity/v2").respond(200, {});
|
||||
|
||||
return awaitLoginComponent(matrixChat)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue