test: add tests for stream chat flutter (#335)

* feat: Added tests

* feat: Added header test

* feat: Added new tests

* fix

* feat: Added test, fmt

* feat: Added delete test

* added system and unread ind tests

* fix: analysis

* added new tests

* fix: analysis

* added tests

* add attachment actions modal tests

* fix analysis

* fix analysis

* add backbutton tests

* fix analysis

* increase timeout

* add channelheader tests

* add infotile tests

* add reactions modal and channel unread indicator tests

* add golden test for reaction bubble

* add dark tests

* add system message golden

* add deletd message golden

* add message action modal tests

* update goldens

* update workflow runner

* update goldens

* remove channel unread indicator in favor of unread indicator

* move file and media screen to sample app

* add channel image tesst

* add channel_list_header test

* add thread_header test

* bump up test threashold

* fix review

Co-authored-by: Salvatore Giordano <[email protected]>
This commit is contained in:
Deven Joshi
2021-04-08 17:43:08 +02:00
committed by GitHub
co-authored by Salvatore Giordano
parent 4946664220
commit a42b3de6f4
58 changed files with 4140 additions and 968 deletions
@@ -34,12 +34,12 @@ class AttachmentActionsModal extends StatelessWidget {
/// Returns a new [AttachmentActionsModal]
const AttachmentActionsModal({
@required this.currentIndex,
this.message,
this.currentIndex,
this.onShowMessage,
this.imageDownloader,
this.fileDownloader,
});
}) : assert(currentIndex != null, 'currentIndex cannot be null');
@override
Widget build(BuildContext context) {
@@ -145,19 +145,20 @@ class AttachmentActionsModal extends StatelessWidget {
() {
final channel = StreamChannel.of(context).channel;
if (message.attachments.length > 1 ||
message.text.isNotEmpty) {
message.text?.isNotEmpty == true) {
final remainingAttachments = [...message.attachments]
..removeAt(currentIndex);
channel.updateMessage(message.copyWith(
attachments: remainingAttachments,
));
Navigator.pop(context);
Navigator.pop(context);
Navigator.of(context)
..pop()
..maybePop();
} else {
channel.deleteMessage(message).then((value) {
Navigator.pop(context);
Navigator.pop(context);
});
channel.deleteMessage(message);
Navigator.of(context)
..pop()
..maybePop();
}
},
color: theme.colorTheme.accentRed,
@@ -185,8 +186,10 @@ class AttachmentActionsModal extends StatelessWidget {
StreamSvgIcon icon,
VoidCallback onTap, {
Color color,
Key key,
}) {
return Material(
key: key,
color: StreamChatTheme.of(context).colorTheme.white,
child: InkWell(
onTap: onTap,
@@ -224,7 +227,7 @@ class AttachmentActionsModal extends StatelessWidget {
if (progress == null || progress?.toProgressIndicatorValue == 1.0) {
Future.delayed(
const Duration(milliseconds: 500),
Navigator.of(context).pop,
Navigator.of(context).maybePop,
);
}
return Material(
@@ -248,6 +251,7 @@ class AttachmentActionsModal extends StatelessWidget {
)
: progress.toProgressIndicatorValue == 1.0
? Container(
key: Key('completedIcon'),
height: 160,
width: 160,
child: StreamSvgIcon.check(