Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 5dae313

Browse files
committed
Update pinning util tests
1 parent e1142c0 commit 5dae313

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

test/utils/PinningUtils-test.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { mocked } from "jest-mock";
2020
import { createTestClient } from "../test-utils";
2121
import PinningUtils from "../../src/utils/PinningUtils";
2222
import SettingsStore from "../../src/settings/SettingsStore";
23-
import { canPinEvent, isContentActionable } from "../../src/utils/EventUtils";
23+
import { isContentActionable } from "../../src/utils/EventUtils";
2424
import { ReadPinsEventId } from "../../src/components/views/right_panel/types";
2525

2626
jest.mock("../../src/utils/EventUtils", () => {
@@ -35,7 +35,6 @@ describe("PinningUtils", () => {
3535
const userId = "@alice:example.org";
3636

3737
const mockedIsContentActionable = mocked(isContentActionable);
38-
const mockedCanPinEvent = mocked(canPinEvent);
3938

4039
let matrixClient: MatrixClient;
4140
let room: Room;
@@ -63,7 +62,6 @@ describe("PinningUtils", () => {
6362
// Enable feature pinning
6463
jest.spyOn(SettingsStore, "getValue").mockReturnValue(true);
6564
mockedIsContentActionable.mockImplementation(() => true);
66-
mockedCanPinEvent.mockImplementation(() => true);
6765

6866
matrixClient = createTestClient();
6967
room = new Room(roomId, matrixClient, userId);
@@ -171,8 +169,7 @@ describe("PinningUtils", () => {
171169
});
172170

173171
test("should return false if event is not pinnable", () => {
174-
mockedCanPinEvent.mockReturnValue(false);
175-
const event = makePinEvent();
172+
const event = makePinEvent({ type: EventType.RoomCreate });
176173

177174
expect(PinningUtils.canPinOrUnpin(matrixClient, event)).toBe(false);
178175
});

0 commit comments

Comments
 (0)