@@ -28,10 +28,11 @@ import {
2828} from './fixtures/responses' ;
2929import { openLightspeed , sendMessage } from './utils/testHelper' ;
3030import {
31- uploadFile ,
31+ uploadFiles ,
3232 uploadAndAssertDuplicate ,
3333 supportedFileTypes ,
3434 validateFailedUpload ,
35+ assertVisibilityState ,
3536} from './utils/fileUpload' ;
3637import {
3738 assertChatDialogInitialState ,
@@ -136,7 +137,7 @@ test.describe('File Attachment Validation', () => {
136137 for ( const { path, name } of testFiles ) {
137138 test ( `should validate file: ${ name } ` , async ( { page } ) => {
138139 const fileExtension = `.${ name . split ( '.' ) . pop ( ) } ` ;
139- await uploadFile ( page , path ) ;
140+ await uploadFiles ( page , [ path ] ) ;
140141
141142 if ( supportedFileTypes . includes ( fileExtension ) ) {
142143 await uploadAndAssertDuplicate ( page , path , name ) ;
@@ -151,6 +152,23 @@ test.describe('File Attachment Validation', () => {
151152 }
152153 } ) ;
153154 }
155+ test ( `Multiple file upload` , async ( { page } ) => {
156+ const file1 = testFiles [ 0 ] . path ;
157+ const file2 = 'backstage.json' ;
158+ await uploadFiles ( page , [ file1 , file2 ] ) ;
159+
160+ const heading = page . getByRole ( 'heading' , {
161+ name : 'Danger alert: File upload' ,
162+ } ) ;
163+ const text = page . getByText ( 'Uploaded more than one file.' ) ;
164+ const closeBtn = page . getByRole ( 'button' , { name : 'Close Danger alert:' } ) ;
165+
166+ await assertVisibilityState ( 'visible' , heading , text , closeBtn ) ;
167+
168+ await closeBtn . click ( ) ;
169+
170+ await assertVisibilityState ( 'hidden' , heading , text , closeBtn ) ;
171+ } ) ;
154172} ) ;
155173
156174test . describe ( 'Conversation' , ( ) => {
0 commit comments