Fixup tests for timelinePanel

This commit is contained in:
Half-Shot
2025-04-14 11:05:56 +01:00
parent dbd533a02c
commit 0330933861

View File

@@ -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(() => {