1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-08-06 10:22:45 +03:00

SettingsStore: Change feature_rust_crypto to default true (#12203)

* Set default crypto stack to rust

* Update test for default to rust crypto

* Fix labs settings tests

* Fix test not working with rust crypto
This commit is contained in:
Valere
2024-02-02 13:20:13 +01:00
committed by GitHub
parent f36b6035f4
commit cb7fd5118e
6 changed files with 225 additions and 68 deletions

View File

@@ -71,6 +71,25 @@ describe("<LabsUserSettingsTab />", () => {
});
describe("Not enabled in config", () => {
// these tests only works if the feature is not enabled in the config by default?
const copyOfGetValueAt = SettingsStore.getValueAt;
beforeEach(() => {
SettingsStore.getValueAt = (
level: SettingLevel,
name: string,
roomId?: string,
isExplicit?: boolean,
) => {
if (level == SettingLevel.CONFIG && name === "feature_rust_crypto") return false;
return copyOfGetValueAt(level, name, roomId, isExplicit);
};
});
afterEach(() => {
SettingsStore.getValueAt = copyOfGetValueAt;
});
it("can be turned on if not already", async () => {
// By the time the settings panel is shown, `MatrixClientPeg.initClientCrypto` has saved the current
// value to the settings store.