Support Matrix 1.1 (drop legacy r0 versions) (#9819)

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Travis Ralston 2023-08-14 02:25:13 -06:00 committed by GitHub
parent f9e79fd5d6
commit 180fcaa70f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 712 additions and 440 deletions

View file

@ -26,6 +26,7 @@ import { MatrixClientPeg } from "../src/MatrixClientPeg";
import Modal from "../src/Modal";
import * as StorageManager from "../src/utils/StorageManager";
import { getMockClientWithEventEmitter, mockPlatformPeg } from "./test-utils";
import ToastStore from "../src/stores/ToastStore";
const webCrypto = new Crypto();
@ -50,6 +51,7 @@ describe("Lifecycle", () => {
store: {
destroy: jest.fn(),
},
getVersions: jest.fn().mockResolvedValue({ versions: ["v1.1"] }),
});
beforeEach(() => {
@ -343,6 +345,22 @@ describe("Lifecycle", () => {
});
});
});
it("should show a toast if the matrix server version is unsupported", async () => {
const toastSpy = jest.spyOn(ToastStore.sharedInstance(), "addOrReplaceToast");
mockClient.getVersions.mockResolvedValue({
versions: ["r0.6.0"],
unstable_features: {},
});
initLocalStorageMock({ ...localStorageSession });
expect(await restoreFromLocalStorage()).toEqual(true);
expect(toastSpy).toHaveBeenCalledWith(
expect.objectContaining({
title: "Your server is unsupported",
}),
);
});
});
});