@@ -1045,20 +1045,24 @@ void main() {
1045
1045
.isA <Icon >().color.isNotNull ().isSameColorAs (expectedIconColor);
1046
1046
}
1047
1047
1048
- group ('attach from media library' , () {
1049
- testWidgets ('success' , (tester) async {
1050
- TypingNotifier .debugEnable = false ;
1051
- addTearDown (TypingNotifier .debugReset);
1048
+ Future <void > prepare (WidgetTester tester) async {
1049
+ TypingNotifier .debugEnable = false ;
1050
+ addTearDown (TypingNotifier .debugReset);
1052
1051
1053
- final channel = eg.stream ();
1054
- final narrow = ChannelNarrow (channel.streamId);
1055
- await prepareComposeBox (tester, narrow: narrow, streams: [channel]);
1052
+ final channel = eg.stream ();
1053
+ final narrow = ChannelNarrow (channel.streamId);
1054
+ await prepareComposeBox (tester, narrow: narrow, streams: [channel]);
1056
1055
1057
- // (When we check that the send button looks disabled, it should be because
1058
- // the file is uploading, not a pre-existing reason.)
1059
- await enterTopic (tester, narrow: narrow, topic: 'some topic' );
1060
- controller! .content.value = const TextEditingValue (text: 'see image: ' );
1061
- await tester.pump ();
1056
+ // (When we check that the send button looks disabled, it should be because
1057
+ // the file is uploading, not a pre-existing reason.)
1058
+ await enterTopic (tester, narrow: narrow, topic: 'some topic' );
1059
+ controller! .content.value = const TextEditingValue (text: 'see image: ' );
1060
+ await tester.pump ();
1061
+ }
1062
+
1063
+ group ('attach from media library' , () {
1064
+ testWidgets ('success' , (tester) async {
1065
+ await prepare (tester);
1062
1066
checkAppearsLoading (tester, false );
1063
1067
1064
1068
testBinding.pickFilesResult = FilePickerResult ([PlatformFile (
@@ -1106,18 +1110,7 @@ void main() {
1106
1110
1107
1111
group ('attach from camera' , () {
1108
1112
testWidgets ('success' , (tester) async {
1109
- TypingNotifier .debugEnable = false ;
1110
- addTearDown (TypingNotifier .debugReset);
1111
-
1112
- final channel = eg.stream ();
1113
- final narrow = ChannelNarrow (channel.streamId);
1114
- await prepareComposeBox (tester, narrow: narrow, streams: [channel]);
1115
-
1116
- // (When we check that the send button looks disabled, it should be because
1117
- // the file is uploading, not a pre-existing reason.)
1118
- await enterTopic (tester, narrow: narrow, topic: 'some topic' );
1119
- controller! .content.value = const TextEditingValue (text: 'see image: ' );
1120
- await tester.pump ();
1113
+ await prepare (tester);
1121
1114
checkAppearsLoading (tester, false );
1122
1115
1123
1116
testBinding.pickImageResult = XFile .fromData (
0 commit comments