@@ -99,7 +99,7 @@ describe("MessageContextMenu", () => {
99
99
100
100
createMenu ( event , { } , { } , undefined , room ) ;
101
101
102
- expect ( document . querySelector ( 'div [aria-label="Pin"]' ) ) . toBeFalsy ( ) ;
102
+ expect ( document . querySelector ( 'li [aria-label="Pin"]' ) ) . toBeFalsy ( ) ;
103
103
} ) ;
104
104
105
105
it ( "does not show pin option for beacon_info event" , ( ) => {
@@ -111,7 +111,7 @@ describe("MessageContextMenu", () => {
111
111
112
112
createMenu ( deadBeaconEvent , { } , { } , undefined , room ) ;
113
113
114
- expect ( document . querySelector ( 'div [aria-label="Pin"]' ) ) . toBeFalsy ( ) ;
114
+ expect ( document . querySelector ( 'li [aria-label="Pin"]' ) ) . toBeFalsy ( ) ;
115
115
} ) ;
116
116
117
117
it ( "does not show pin option when pinning feature is disabled" , ( ) => {
@@ -130,7 +130,7 @@ describe("MessageContextMenu", () => {
130
130
131
131
createMenu ( pinnableEvent , { } , { } , undefined , room ) ;
132
132
133
- expect ( document . querySelector ( 'div [aria-label="Pin"]' ) ) . toBeFalsy ( ) ;
133
+ expect ( document . querySelector ( 'li [aria-label="Pin"]' ) ) . toBeFalsy ( ) ;
134
134
} ) ;
135
135
136
136
it ( "shows pin option when pinning feature is enabled" , ( ) => {
@@ -147,7 +147,7 @@ describe("MessageContextMenu", () => {
147
147
148
148
createMenu ( pinnableEvent , { } , { } , undefined , room ) ;
149
149
150
- expect ( document . querySelector ( 'div [aria-label="Pin"]' ) ) . toBeTruthy ( ) ;
150
+ expect ( document . querySelector ( 'li [aria-label="Pin"]' ) ) . toBeTruthy ( ) ;
151
151
} ) ;
152
152
153
153
it ( "pins event on pin option click" , ( ) => {
@@ -171,7 +171,7 @@ describe("MessageContextMenu", () => {
171
171
172
172
createMenu ( pinnableEvent , { onFinished } , { } , undefined , room ) ;
173
173
174
- fireEvent . click ( document . querySelector ( 'div [aria-label="Pin"]' ) ! ) ;
174
+ fireEvent . click ( document . querySelector ( 'li [aria-label="Pin"]' ) ! ) ;
175
175
176
176
// added to account data
177
177
expect ( client . setRoomAccountData ) . toHaveBeenCalledWith ( roomId , ReadPinsEventId , {
@@ -225,7 +225,7 @@ describe("MessageContextMenu", () => {
225
225
226
226
createMenu ( pinnableEvent , { } , { } , undefined , room ) ;
227
227
228
- fireEvent . click ( document . querySelector ( 'div [aria-label="Unpin"]' ) ! ) ;
228
+ fireEvent . click ( document . querySelector ( 'li [aria-label="Unpin"]' ) ! ) ;
229
229
230
230
expect ( client . setRoomAccountData ) . not . toHaveBeenCalled ( ) ;
231
231
@@ -244,13 +244,13 @@ describe("MessageContextMenu", () => {
244
244
it ( "allows forwarding a room message" , ( ) => {
245
245
const eventContent = createMessageEventContent ( "hello" ) ;
246
246
createMenuWithContent ( eventContent ) ;
247
- expect ( document . querySelector ( 'div [aria-label="Forward"]' ) ) . toBeTruthy ( ) ;
247
+ expect ( document . querySelector ( 'li [aria-label="Forward"]' ) ) . toBeTruthy ( ) ;
248
248
} ) ;
249
249
250
250
it ( "does not allow forwarding a poll" , ( ) => {
251
251
const eventContent = PollStartEvent . from ( "why?" , [ "42" ] , M_POLL_KIND_DISCLOSED ) ;
252
252
createMenuWithContent ( eventContent ) ;
253
- expect ( document . querySelector ( 'div [aria-label="Forward"]' ) ) . toBeFalsy ( ) ;
253
+ expect ( document . querySelector ( 'li [aria-label="Forward"]' ) ) . toBeFalsy ( ) ;
254
254
} ) ;
255
255
256
256
it ( "should not allow forwarding a voice broadcast" , ( ) => {
@@ -261,7 +261,7 @@ describe("MessageContextMenu", () => {
261
261
"ABC123" ,
262
262
) ;
263
263
createMenu ( broadcastStartEvent ) ;
264
- expect ( document . querySelector ( 'div [aria-label="Forward"]' ) ) . toBeFalsy ( ) ;
264
+ expect ( document . querySelector ( 'li [aria-label="Forward"]' ) ) . toBeFalsy ( ) ;
265
265
} ) ;
266
266
267
267
describe ( "forwarding beacons" , ( ) => {
@@ -273,7 +273,7 @@ describe("MessageContextMenu", () => {
273
273
const beacons = new Map < BeaconIdentifier , Beacon > ( ) ;
274
274
beacons . set ( getBeaconInfoIdentifier ( deadBeaconEvent ) , beacon ) ;
275
275
createMenu ( deadBeaconEvent , { } , { } , beacons ) ;
276
- expect ( document . querySelector ( 'div [aria-label="Forward"]' ) ) . toBeFalsy ( ) ;
276
+ expect ( document . querySelector ( 'li [aria-label="Forward"]' ) ) . toBeFalsy ( ) ;
277
277
} ) ;
278
278
279
279
it ( "does not allow forwarding a beacon that is not live but has a latestLocation" , ( ) => {
@@ -288,7 +288,7 @@ describe("MessageContextMenu", () => {
288
288
const beacons = new Map < BeaconIdentifier , Beacon > ( ) ;
289
289
beacons . set ( getBeaconInfoIdentifier ( deadBeaconEvent ) , beacon ) ;
290
290
createMenu ( deadBeaconEvent , { } , { } , beacons ) ;
291
- expect ( document . querySelector ( 'div [aria-label="Forward"]' ) ) . toBeFalsy ( ) ;
291
+ expect ( document . querySelector ( 'li [aria-label="Forward"]' ) ) . toBeFalsy ( ) ;
292
292
} ) ;
293
293
294
294
it ( "does not allow forwarding a live beacon that does not have a latestLocation" , ( ) => {
@@ -298,7 +298,7 @@ describe("MessageContextMenu", () => {
298
298
const beacons = new Map < BeaconIdentifier , Beacon > ( ) ;
299
299
beacons . set ( getBeaconInfoIdentifier ( beaconEvent ) , beacon ) ;
300
300
createMenu ( beaconEvent , { } , { } , beacons ) ;
301
- expect ( document . querySelector ( 'div [aria-label="Forward"]' ) ) . toBeFalsy ( ) ;
301
+ expect ( document . querySelector ( 'li [aria-label="Forward"]' ) ) . toBeFalsy ( ) ;
302
302
} ) ;
303
303
304
304
it ( "allows forwarding a live beacon that has a location" , ( ) => {
@@ -313,7 +313,7 @@ describe("MessageContextMenu", () => {
313
313
const beacons = new Map < BeaconIdentifier , Beacon > ( ) ;
314
314
beacons . set ( getBeaconInfoIdentifier ( liveBeaconEvent ) , beacon ) ;
315
315
createMenu ( liveBeaconEvent , { } , { } , beacons ) ;
316
- expect ( document . querySelector ( 'div [aria-label="Forward"]' ) ) . toBeTruthy ( ) ;
316
+ expect ( document . querySelector ( 'li [aria-label="Forward"]' ) ) . toBeTruthy ( ) ;
317
317
} ) ;
318
318
319
319
it ( "opens forward dialog with correct event" , ( ) => {
@@ -330,7 +330,7 @@ describe("MessageContextMenu", () => {
330
330
beacons . set ( getBeaconInfoIdentifier ( liveBeaconEvent ) , beacon ) ;
331
331
createMenu ( liveBeaconEvent , { } , { } , beacons ) ;
332
332
333
- fireEvent . click ( document . querySelector ( 'div [aria-label="Forward"]' ) ! ) ;
333
+ fireEvent . click ( document . querySelector ( 'li [aria-label="Forward"]' ) ! ) ;
334
334
335
335
// called with forwardableEvent, not beaconInfo event
336
336
expect ( dispatchSpy ) . toHaveBeenCalledWith (
@@ -395,7 +395,7 @@ describe("MessageContextMenu", () => {
395
395
mocked ( getSelectedText ) . mockReturnValue ( text ) ;
396
396
397
397
createRightClickMenuWithContent ( eventContent ) ;
398
- const copyButton = document . querySelector ( 'div [aria-label="Copy"]' ) ! ;
398
+ const copyButton = document . querySelector ( 'li [aria-label="Copy"]' ) ! ;
399
399
fireEvent . mouseDown ( copyButton ) ;
400
400
expect ( copyPlaintext ) . toHaveBeenCalledWith ( text ) ;
401
401
} ) ;
@@ -406,7 +406,7 @@ describe("MessageContextMenu", () => {
406
406
mocked ( getSelectedText ) . mockReturnValue ( "" ) ;
407
407
408
408
createRightClickMenuWithContent ( eventContent ) ;
409
- const copyButton = document . querySelector ( 'div [aria-label="Copy"]' ) ;
409
+ const copyButton = document . querySelector ( 'li [aria-label="Copy"]' ) ;
410
410
expect ( copyButton ) . toBeFalsy ( ) ;
411
411
} ) ;
412
412
@@ -415,7 +415,7 @@ describe("MessageContextMenu", () => {
415
415
mocked ( canEditContent ) . mockReturnValue ( true ) ;
416
416
417
417
createRightClickMenuWithContent ( eventContent ) ;
418
- const editButton = document . querySelector ( 'div [aria-label="Edit"]' ) ;
418
+ const editButton = document . querySelector ( 'li [aria-label="Edit"]' ) ;
419
419
expect ( editButton ) . toBeTruthy ( ) ;
420
420
} ) ;
421
421
@@ -424,7 +424,7 @@ describe("MessageContextMenu", () => {
424
424
mocked ( canEditContent ) . mockReturnValue ( false ) ;
425
425
426
426
createRightClickMenuWithContent ( eventContent ) ;
427
- const editButton = document . querySelector ( 'div [aria-label="Edit"]' ) ;
427
+ const editButton = document . querySelector ( 'li [aria-label="Edit"]' ) ;
428
428
expect ( editButton ) . toBeFalsy ( ) ;
429
429
} ) ;
430
430
@@ -435,7 +435,7 @@ describe("MessageContextMenu", () => {
435
435
} ;
436
436
437
437
createRightClickMenuWithContent ( eventContent , context ) ;
438
- const replyButton = document . querySelector ( 'div [aria-label="Reply"]' ) ;
438
+ const replyButton = document . querySelector ( 'li [aria-label="Reply"]' ) ;
439
439
expect ( replyButton ) . toBeTruthy ( ) ;
440
440
} ) ;
441
441
@@ -449,7 +449,7 @@ describe("MessageContextMenu", () => {
449
449
unsentMessage . setStatus ( EventStatus . QUEUED ) ;
450
450
451
451
createMenu ( unsentMessage , { } , context ) ;
452
- const replyButton = document . querySelector ( 'div [aria-label="Reply"]' ) ;
452
+ const replyButton = document . querySelector ( 'li [aria-label="Reply"]' ) ;
453
453
expect ( replyButton ) . toBeFalsy ( ) ;
454
454
} ) ;
455
455
@@ -460,7 +460,7 @@ describe("MessageContextMenu", () => {
460
460
} ;
461
461
462
462
createRightClickMenuWithContent ( eventContent , context ) ;
463
- const reactButton = document . querySelector ( 'div [aria-label="React"]' ) ;
463
+ const reactButton = document . querySelector ( 'li [aria-label="React"]' ) ;
464
464
expect ( reactButton ) . toBeTruthy ( ) ;
465
465
} ) ;
466
466
@@ -471,7 +471,7 @@ describe("MessageContextMenu", () => {
471
471
} ;
472
472
473
473
createRightClickMenuWithContent ( eventContent , context ) ;
474
- const reactButton = document . querySelector ( 'div [aria-label="React"]' ) ;
474
+ const reactButton = document . querySelector ( 'li [aria-label="React"]' ) ;
475
475
expect ( reactButton ) . toBeFalsy ( ) ;
476
476
} ) ;
477
477
@@ -487,15 +487,15 @@ describe("MessageContextMenu", () => {
487
487
} ;
488
488
489
489
createMenu ( mxEvent , props , context ) ;
490
- const reactButton = document . querySelector ( 'div [aria-label="View in room"]' ) ;
490
+ const reactButton = document . querySelector ( 'li [aria-label="View in room"]' ) ;
491
491
expect ( reactButton ) . toBeTruthy ( ) ;
492
492
} ) ;
493
493
494
494
it ( "does not show view in room button when the event is not a thread root" , ( ) => {
495
495
const eventContent = createMessageEventContent ( "hello" ) ;
496
496
497
497
createRightClickMenuWithContent ( eventContent ) ;
498
- const reactButton = document . querySelector ( 'div [aria-label="View in room"]' ) ;
498
+ const reactButton = document . querySelector ( 'li [aria-label="View in room"]' ) ;
499
499
expect ( reactButton ) . toBeFalsy ( ) ;
500
500
} ) ;
501
501
@@ -511,7 +511,7 @@ describe("MessageContextMenu", () => {
511
511
512
512
createRightClickMenu ( mxEvent , context ) ;
513
513
514
- const replyInThreadButton = document . querySelector ( 'div [aria-label="Reply in thread"]' ) ! ;
514
+ const replyInThreadButton = document . querySelector ( 'li [aria-label="Reply in thread"]' ) ! ;
515
515
fireEvent . click ( replyInThreadButton ) ;
516
516
517
517
expect ( dispatcher . dispatch ) . toHaveBeenCalledWith ( {
0 commit comments