diff --git a/packages/stream_chat_flutter/test/src/attachment_actions_modal_test.dart b/packages/stream_chat_flutter/test/src/attachment_actions_modal_test.dart index 2d42f558..d59b8002 100644 --- a/packages/stream_chat_flutter/test/src/attachment_actions_modal_test.dart +++ b/packages/stream_chat_flutter/test/src/attachment_actions_modal_test.dart @@ -452,15 +452,16 @@ void main() { await tester.tap(find.text('Save Image')); - imageDownloader.progressCallback!(0, 100); + imageDownloader.progressCallback!(0, 100000); await tester.pump(); - expect(find.text('0%'), findsOneWidget); + expect(find.text('0.00 MB'), findsOneWidget); - imageDownloader.progressCallback!(50, 100); + imageDownloader.progressCallback!(50000, 100000); await tester.pump(); - expect(find.text('50%'), findsOneWidget); + expect(find.text('0.05 MB'), findsOneWidget); - imageDownloader.progressCallback!(100, 100); + imageDownloader.progressCallback!(100000, 100000); + imageDownloader.downloadedPathCallback!('path'); imageDownloader.completer.complete('path'); await tester.pump(); expect(find.byKey(const Key('completedIcon')), findsOneWidget); @@ -510,15 +511,16 @@ void main() { await tester.tap(find.text('Save Video')); - fileDownloader.progressCallback!(0, 100); + fileDownloader.progressCallback!(0, 100000); await tester.pump(); - expect(find.text('0%'), findsOneWidget); + expect(find.text('0.00 MB'), findsOneWidget); - fileDownloader.progressCallback!(50, 100); + fileDownloader.progressCallback!(50000, 100000); await tester.pump(); - expect(find.text('50%'), findsOneWidget); + expect(find.text('0.05 MB'), findsOneWidget); - fileDownloader.progressCallback!(100, 100); + fileDownloader.progressCallback!(100000, 100000); + fileDownloader.downloadedPathCallback!('path'); fileDownloader.completer.complete('path'); await tester.pump(); expect(find.byKey(const Key('completedIcon')), findsOneWidget); diff --git a/packages/stream_chat_flutter/test/src/theme/gallery_header_theme_test.dart b/packages/stream_chat_flutter/test/src/theme/gallery_header_theme_test.dart index 50be7d57..651da1ce 100644 --- a/packages/stream_chat_flutter/test/src/theme/gallery_header_theme_test.dart +++ b/packages/stream_chat_flutter/test/src/theme/gallery_header_theme_test.dart @@ -66,7 +66,16 @@ void main() { home: Builder( builder: (context) { _context = context; - final _message = Message(); + final attachment = Attachment( + type: 'video', + title: 'video.mp4', + ); + final _message = Message( + createdAt: DateTime.now(), + attachments: [ + attachment, + ], + ); return Scaffold( appBar: StreamGalleryHeader( message: _message, @@ -107,7 +116,16 @@ void main() { home: Builder( builder: (context) { _context = context; - final _message = Message(); + final attachment = Attachment( + type: 'video', + title: 'video.mp4', + ); + final _message = Message( + createdAt: DateTime.now(), + attachments: [ + attachment, + ], + ); return Scaffold( appBar: StreamGalleryHeader( message: _message,