Update tests to use SettingsStore where possible.

This commit is contained in:
Half-Shot
2025-04-14 12:24:11 +01:00
parent 4a11e0e454
commit 2c95cf118a
6 changed files with 55 additions and 48 deletions

View File

@@ -486,7 +486,7 @@ describe("<MatrixChat />", () => {
afterEach(() => {
SettingsStore.reset();
})
});
it("should persist login credentials", async () => {
getComponent({ realQueryParams });

View File

@@ -313,8 +313,7 @@ describe("TimelinePanel", () => {
describe("and sending receipts is disabled", () => {
beforeEach(async () => {
// Ensure this setting is supported, otherwise it will use the default value.
client.isVersionSupported.mockResolvedValue(true);
client.doesServerSupportUnstableFeature.mockResolvedValue(true);
client.isVersionSupported.mockImplementation(async (v) => v === "v1.4");
MatrixClientBackedController.matrixClient = client;
SettingsStore.setValue("sendReadReceipts", null, SettingLevel.DEVICE, false);
});