@@ -345,7 +345,8 @@ describe("Spotlight", () => {
345
345
cy . spotlightFilter ( Filter . People ) ;
346
346
cy . spotlightSearch ( ) . clear ( ) . type ( bot2Name ) ;
347
347
cy . spotlightResults ( ) . should ( "have.length" , 1 ) ;
348
- cy . spotlightResults ( ) . contains ( bot2Name ) . click ( ) ;
348
+ cy . spotlightResults ( ) . eq ( 0 ) . should ( "contain" , bot2Name ) ;
349
+ cy . spotlightResults ( ) . eq ( 0 ) . click ( ) ;
349
350
} )
350
351
. then ( ( ) => {
351
352
cy . roomHeaderName ( ) . should ( "contain" , bot2Name ) ;
@@ -360,7 +361,9 @@ describe("Spotlight", () => {
360
361
cy . openSpotlightDialog ( ) . within ( ( ) => {
361
362
cy . spotlightFilter ( Filter . People ) ;
362
363
cy . spotlightSearch ( ) . clear ( ) . type ( bot2Name ) ;
363
- cy . spotlightResults ( ) . contains ( bot2Name ) . click ( ) ;
364
+ cy . spotlightResults ( ) . should ( "have.length" , 1 ) ;
365
+ cy . spotlightResults ( ) . eq ( 0 ) . should ( "contain" , bot2Name ) ;
366
+ cy . spotlightResults ( ) . eq ( 0 ) . click ( ) ;
364
367
} ) ;
365
368
366
369
// Send first message to actually start DM
@@ -387,21 +390,23 @@ describe("Spotlight", () => {
387
390
cy . spotlightFilter ( Filter . People ) ;
388
391
cy . spotlightSearch ( ) . clear ( ) . type ( bot1 . getUserId ( ) ) ;
389
392
cy . wait ( 1000 ) ; // wait for the dialog code to settle
393
+ cy . spotlightResults ( ) . should ( "have.length" , 2 ) ;
390
394
cy . contains (
391
395
".mx_SpotlightDialog_section.mx_SpotlightDialog_results .mx_SpotlightDialog_option" ,
392
396
groupDm . name ,
393
- ) . should ( "exist" ) ;
397
+ ) ;
394
398
} ) ;
395
399
396
400
// Search for ByteBot by id, should return group DM and user
397
401
cy . openSpotlightDialog ( ) . within ( ( ) => {
398
402
cy . spotlightFilter ( Filter . People ) ;
399
403
cy . spotlightSearch ( ) . clear ( ) . type ( bot2 . getUserId ( ) ) ;
400
404
cy . wait ( 1000 ) ; // wait for the dialog code to settle
405
+ cy . spotlightResults ( ) . should ( "have.length" , 2 ) ;
401
406
cy . contains (
402
407
".mx_SpotlightDialog_section.mx_SpotlightDialog_results .mx_SpotlightDialog_option" ,
403
408
groupDm . name ,
404
- ) . should ( "exist" ) ;
409
+ ) ;
405
410
} ) ;
406
411
} ) ;
407
412
} ) ;
@@ -431,7 +436,9 @@ describe("Spotlight", () => {
431
436
. within ( ( ) => {
432
437
cy . spotlightFilter ( Filter . People ) ;
433
438
cy . spotlightSearch ( ) . clear ( ) . type ( bot2Name ) ;
434
- cy . spotlightResults ( ) . should ( "contain" , bot2Name ) ;
439
+ cy . wait ( 3000 ) ; // wait for the dialog code to settle
440
+ cy . spotlightResults ( ) . should ( "have.length" , 1 ) ;
441
+ cy . spotlightResults ( ) . eq ( 0 ) . should ( "contain" , bot2Name ) ;
435
442
cy . get ( ".mx_SpotlightDialog_startGroupChat" ) . should ( "contain" , "Start a group chat" ) ;
436
443
cy . get ( ".mx_SpotlightDialog_startGroupChat" ) . click ( ) ;
437
444
} )
0 commit comments