@@ -237,13 +237,32 @@ describe('MessageInputComponent', () => {
237237 } ) ;
238238
239239 it ( `shouldn't send message, if file uploads are in progress` , async ( ) => {
240+ const notificationService = TestBed . inject ( NotificationService ) ;
241+ spyOn ( notificationService , 'addPermanentNotification' ) ;
240242 uploadAttachmentsSpy . and . resolveTo ( [ ] ) ;
241243 void component . filesSelected ( [ { type : 'image/png' } ] as any as FileList ) ;
242244 await component . messageSent ( ) ;
243245
244246 expect ( sendMessageSpy ) . not . toHaveBeenCalled ( ) ;
247+ expect ( notificationService . addPermanentNotification ) . toHaveBeenCalledWith (
248+ 'streamChat.Wait until all attachments have uploaded'
249+ ) ;
245250 } ) ;
246251
252+ it ( 'should hide "Wait for upload" notification, if upload is finished' , fakeAsync ( ( ) => {
253+ const notificationService = TestBed . inject ( NotificationService ) ;
254+ const removeNotificationSpy = jasmine . createSpy ( ) ;
255+ spyOn ( notificationService , 'addPermanentNotification' ) . and . returnValue (
256+ removeNotificationSpy
257+ ) ;
258+ uploadAttachmentsSpy . and . resolveTo ( [ ] ) ;
259+ void component . filesSelected ( [ { type : 'image/png' } ] as any as FileList ) ;
260+ void component . messageSent ( ) ;
261+ tick ( ) ;
262+
263+ expect ( removeNotificationSpy ) . toHaveBeenCalledWith ( ) ;
264+ } ) ) ;
265+
247266 it ( `shouldn't send message, if file uploads are in progress - multiple uploads` , fakeAsync ( ( ) => {
248267 uploadAttachmentsSpy . and . resolveTo ( [ ] ) ;
249268 void component . filesSelected ( [ { type : 'image/png' } ] as any as FileList ) ;
0 commit comments