Support Matrix 1.1 (drop legacy r0 versions) (#9819)
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
f9e79fd5d6
commit
180fcaa70f
32 changed files with 712 additions and 440 deletions
|
@ -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",
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue