@@ -115,9 +115,11 @@ void main() {
115
115
.controller.isNotNull ().value.text.equals (expected);
116
116
}
117
117
118
+ final sendButtonFinder = find.byIcon (ZulipIcons .send);
119
+
118
120
Future <void > tapSendButton (WidgetTester tester) async {
119
121
connection.prepare (json: SendMessageResult (id: 123 ).toJson ());
120
- await tester.tap (find. byIcon ( ZulipIcons .send) );
122
+ await tester.tap (sendButtonFinder );
121
123
await tester.pump (Duration .zero);
122
124
}
123
125
@@ -690,7 +692,7 @@ void main() {
690
692
691
693
connection.prepare (json: {});
692
694
connection.prepare (json: SendMessageResult (id: 123 ).toJson ());
693
- await tester.tap (find. byIcon ( ZulipIcons .send) );
695
+ await tester.tap (sendButtonFinder );
694
696
await tester.pump (Duration .zero);
695
697
final requests = connection.takeRequests ();
696
698
checkSetTypingStatusRequests ([requests.first], [(TypingOp .stop, narrow)]);
@@ -854,7 +856,7 @@ void main() {
854
856
855
857
await enterTopic (tester, narrow: narrow, topic: topicInputText);
856
858
await tester.enterText (contentInputFinder, 'test content' );
857
- await tester.tap (find. byIcon ( ZulipIcons .send) );
859
+ await tester.tap (sendButtonFinder );
858
860
await tester.pump ();
859
861
}
860
862
@@ -911,7 +913,7 @@ void main() {
911
913
group ('uploads' , () {
912
914
void checkAppearsLoading (WidgetTester tester, bool expected) {
913
915
final sendButtonElement = tester.element (find.ancestor (
914
- of: find. byIcon ( ZulipIcons .send) ,
916
+ of: sendButtonFinder ,
915
917
matching: find.byType (IconButton )));
916
918
final sendButtonWidget = sendButtonElement.widget as IconButton ;
917
919
final designVariables = DesignVariables .of (sendButtonElement);
0 commit comments