@@ -77,11 +77,8 @@ export async function openAiAssistant(page: Page) {
77
77
document . querySelector ( '[data-test-close-ai-assistant]' ) ,
78
78
) ;
79
79
80
- await page . waitForFunction (
81
- ( ) =>
82
- document
83
- . querySelector ( '[data-test-room]' )
84
- ?. getAttribute ( 'data-test-room' ) ,
80
+ await page . waitForFunction ( ( ) =>
81
+ document . querySelector ( '[data-test-room]' ) ?. getAttribute ( 'data-test-room' ) ,
85
82
) ; // Opening the AI assistant either opens last room or creates one - wait for it to settle
86
83
}
87
84
@@ -492,7 +489,7 @@ export async function assertMessages(
492
489
`[data-test-message-idx="${ index } "] [data-test-attached-card]` ,
493
490
) ,
494
491
) . toHaveCount ( cards . length ) ;
495
- cards . map ( async ( card ) => {
492
+ for ( let card of cards ) {
496
493
if ( card . title ) {
497
494
if ( message != null && card . title . includes ( message ) ) {
498
495
throw new Error (
@@ -514,7 +511,7 @@ export async function assertMessages(
514
511
) ,
515
512
) . toHaveCount ( 1 ) ;
516
513
}
517
- } ) ;
514
+ }
518
515
}
519
516
520
517
if ( files ?. length ) {
@@ -524,13 +521,16 @@ export async function assertMessages(
524
521
) ,
525
522
) . toHaveCount ( 1 ) ;
526
523
await expect (
527
- page . locator ( `[data-test-message-idx="${ index } "] [data-test-attached-file]` ) ) . toHaveCount ( files . length )
524
+ page . locator (
525
+ `[data-test-message-idx="${ index } "] [data-test-attached-file]` ,
526
+ ) ,
527
+ ) . toHaveCount ( files . length ) ;
528
528
files . map ( async ( file ) => {
529
- await expect (
530
- page . locator (
531
- `[data-test-message-idx="${ index } "] [data-test-attached-file="${ file . sourceUrl } "]` ,
532
- ) ,
533
- ) . toContainText ( file . name ) ;
529
+ await expect (
530
+ page . locator (
531
+ `[data-test-message-idx="${ index } "] [data-test-attached-file="${ file . sourceUrl } "]` ,
532
+ ) ,
533
+ ) . toContainText ( file . name ) ;
534
534
} ) ;
535
535
}
536
536
0 commit comments