@@ -117,9 +117,11 @@ void main() {
117
117
.controller.isNotNull ().value.text.equals (expected);
118
118
}
119
119
120
+ final sendButtonFinder = find.byIcon (ZulipIcons .send);
121
+
120
122
Future <void > tapSendButton (WidgetTester tester) async {
121
123
connection.prepare (json: SendMessageResult (id: 123 ).toJson ());
122
- await tester.tap (find. byIcon ( ZulipIcons .send) );
124
+ await tester.tap (sendButtonFinder );
123
125
await tester.pump (Duration .zero);
124
126
}
125
127
@@ -618,7 +620,7 @@ void main() {
618
620
619
621
connection.prepare (json: {});
620
622
connection.prepare (json: SendMessageResult (id: 123 ).toJson ());
621
- await tester.tap (find. byIcon ( ZulipIcons .send) );
623
+ await tester.tap (sendButtonFinder );
622
624
await tester.pump (Duration .zero);
623
625
final requests = connection.takeRequests ();
624
626
checkSetTypingStatusRequests ([requests.first], [(TypingOp .stop, narrow)]);
@@ -782,7 +784,7 @@ void main() {
782
784
783
785
await enterTopic (tester, narrow: narrow, topic: topicInputText);
784
786
await tester.enterText (contentInputFinder, 'test content' );
785
- await tester.tap (find. byIcon ( ZulipIcons .send) );
787
+ await tester.tap (sendButtonFinder );
786
788
await tester.pump ();
787
789
}
788
790
@@ -839,7 +841,7 @@ void main() {
839
841
group ('uploads' , () {
840
842
void checkAppearsLoading (WidgetTester tester, bool expected) {
841
843
final sendButtonElement = tester.element (find.ancestor (
842
- of: find. byIcon ( ZulipIcons .send) ,
844
+ of: sendButtonFinder ,
843
845
matching: find.byType (IconButton )));
844
846
final sendButtonWidget = sendButtonElement.widget as IconButton ;
845
847
final designVariables = DesignVariables .of (sendButtonElement);
0 commit comments