Fixed failing tests

This commit is contained in:
Ayush Shekhar
2022-04-14 14:37:39 +05:30
parent 9d0f66ee8c
commit 478033078f
3 changed files with 32 additions and 16 deletions
@@ -36,11 +36,7 @@ dependencies:
rxdart: ^0.27.0
share_plus: ^4.0.1
shimmer: ^2.0.0
<<<<<<< HEAD
stream_chat_flutter_core: ^4.0.0-beta.0
=======
stream_chat_flutter_core: ^3.6.1
>>>>>>> develop
substring_highlight: ^1.0.26
url_launcher: ^6.0.3
video_player: ^2.1.0
@@ -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);
@@ -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,