@@ -20,7 +20,7 @@ import { mocked } from "jest-mock";
2020import { createTestClient } from "../test-utils" ;
2121import PinningUtils from "../../src/utils/PinningUtils" ;
2222import SettingsStore from "../../src/settings/SettingsStore" ;
23- import { canPinEvent , isContentActionable } from "../../src/utils/EventUtils" ;
23+ import { isContentActionable } from "../../src/utils/EventUtils" ;
2424import { ReadPinsEventId } from "../../src/components/views/right_panel/types" ;
2525
2626jest . 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