@@ -32,6 +32,7 @@ import DMRoomMap from "../../../../src/utils/DMRoomMap";
32
32
import dis from "../../../../src/dispatcher/dispatcher" ;
33
33
import { Action } from "../../../../src/dispatcher/actions" ;
34
34
import { IRoomState } from "../../../../src/components/structures/RoomView" ;
35
+ import PinningUtils from "../../../../src/utils/PinningUtils.ts" ;
35
36
36
37
describe ( "EventTile" , ( ) => {
37
38
const ROOM_ID = "!roomId:example.org" ;
@@ -91,6 +92,10 @@ describe("EventTile", () => {
91
92
} ) ;
92
93
} ) ;
93
94
95
+ afterEach ( ( ) => {
96
+ jest . spyOn ( PinningUtils , "isPinned" ) . mockReturnValue ( false ) ;
97
+ } ) ;
98
+
94
99
describe ( "EventTile thread summary" , ( ) => {
95
100
beforeEach ( ( ) => {
96
101
jest . spyOn ( client , "supportsThreads" ) . mockReturnValue ( true ) ;
@@ -154,6 +159,15 @@ describe("EventTile", () => {
154
159
} ) ;
155
160
} ) ;
156
161
162
+ describe ( "EventTile renderingType: Threads" , ( ) => {
163
+ it ( "should display the pinned message badge" , async ( ) => {
164
+ jest . spyOn ( PinningUtils , "isPinned" ) . mockReturnValue ( true ) ;
165
+ getComponent ( { } , TimelineRenderingType . Thread ) ;
166
+
167
+ expect ( screen . getByText ( "Pinned message" ) ) . toBeInTheDocument ( ) ;
168
+ } ) ;
169
+ } ) ;
170
+
157
171
describe ( "EventTile in the right panel" , ( ) => {
158
172
beforeAll ( ( ) => {
159
173
const dmRoomMap : DMRoomMap = {
@@ -510,4 +524,10 @@ describe("EventTile", () => {
510
524
} ) ;
511
525
} ) ;
512
526
} ) ;
527
+
528
+ test ( "it should render a pinned message badge" , async ( ) => {
529
+ jest . spyOn ( PinningUtils , "isPinned" ) . mockReturnValue ( true ) ;
530
+ getComponent ( ) ;
531
+ expect ( screen . getByText ( "Pinned message" ) ) . toBeInTheDocument ( ) ;
532
+ } ) ;
513
533
} ) ;
0 commit comments