From 033093386127f0b39378ecf8a0938efd41aecc57 Mon Sep 17 00:00:00 2001 From: Half-Shot Date: Mon, 14 Apr 2025 11:05:56 +0100 Subject: [PATCH] Fixup tests for timelinePanel --- test/unit-tests/components/structures/TimelinePanel-test.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/unit-tests/components/structures/TimelinePanel-test.tsx b/test/unit-tests/components/structures/TimelinePanel-test.tsx index 0a577729db..39dbcf64b5 100644 --- a/test/unit-tests/components/structures/TimelinePanel-test.tsx +++ b/test/unit-tests/components/structures/TimelinePanel-test.tsx @@ -51,6 +51,7 @@ import ScrollPanel from "../../../../src/components/structures/ScrollPanel"; import defaultDispatcher from "../../../../src/dispatcher/dispatcher"; import { Action } from "../../../../src/dispatcher/actions"; import { SettingLevel } from "../../../../src/settings/SettingLevel"; +import MatrixClientBackedController from "../../../../src/settings/controllers/MatrixClientBackedController"; // ScrollPanel calls this, but jsdom doesn't mock it for us HTMLDivElement.prototype.scrollBy = () => {}; @@ -311,9 +312,11 @@ 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); - SettingsStore.setValue("sendReadReceipts", null, SettingLevel.ACCOUNT, false); + MatrixClientBackedController.matrixClient = client; + SettingsStore.setValue("sendReadReceipts", null, SettingLevel.DEVICE, false); }); afterEach(() => {