Migrate all pinning checks and actions into PinningUtils (#12964)

This commit is contained in:
Florian Duros 2024-09-05 16:37:24 +02:00 committed by GitHub
parent 26399237f6
commit 5bfbca9eb0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 146 additions and 67 deletions

View file

@ -27,6 +27,7 @@ import dis from "../../../../src/dispatcher/dispatcher";
import { Action } from "../../../../src/dispatcher/actions";
import { getForwardableEvent } from "../../../../src/events";
import { createRedactEventDialog } from "../../../../src/components/views/dialogs/ConfirmRedactDialog";
import SettingsStore from "../../../../src/settings/SettingsStore.ts";
jest.mock("../../../../src/components/views/dialogs/ConfirmRedactDialog", () => ({
createRedactEventDialog: jest.fn(),
@ -43,7 +44,10 @@ describe("<PinnedEventTile />", () => {
mockClient = stubClient();
room = new Room(roomId, mockClient, userId);
permalinkCreator = new RoomPermalinkCreator(room);
mockClient.getRoom = jest.fn().mockReturnValue(room);
jest.spyOn(dis, "dispatch").mockReturnValue(undefined);
// Enable feature_pinning
jest.spyOn(SettingsStore, "getValue").mockReturnValue(true);
});
/**