@@ -125,6 +125,19 @@ void main() {
125
125
await store.addMessage (message);
126
126
}
127
127
128
+ void checkButtons () {
129
+ final actionSheetFinder = find.byType (BottomSheet );
130
+ check (actionSheetFinder).findsOne ();
131
+
132
+ void checkButton (String label) {
133
+ check (
134
+ find.descendant (of: actionSheetFinder, matching: find.text (label))
135
+ ).findsOne ();
136
+ }
137
+
138
+ checkButton ('Follow topic' );
139
+ }
140
+
128
141
testWidgets ('show from inbox' , (tester) async {
129
142
await prepare ();
130
143
await tester.pumpWidget (TestZulipApp (accountId: eg.selfAccount.id,
@@ -135,8 +148,7 @@ void main() {
135
148
await tester.longPress (find.text (topic));
136
149
// sheet appears onscreen; default duration of bottom-sheet enter animation
137
150
await tester.pump (const Duration (milliseconds: 250 ));
138
- check (find.byType (BottomSheet )).findsOne ();
139
- check (find.text ('Follow topic' )).findsOne ();
151
+ checkButtons ();
140
152
});
141
153
142
154
testWidgets ('show from app bar' , (tester) async {
@@ -153,8 +165,7 @@ void main() {
153
165
await tester.longPress (topicRow);
154
166
// sheet appears onscreen; default duration of bottom-sheet enter animation
155
167
await tester.pump (const Duration (milliseconds: 250 ));
156
- check (find.byType (BottomSheet )).findsOne ();
157
- check (find.text ('Follow topic' )).findsOne ();
168
+ checkButtons ();
158
169
});
159
170
160
171
testWidgets ('show from recipient header' , (tester) async {
@@ -170,8 +181,7 @@ void main() {
170
181
of: find.byType (RecipientHeader ), matching: find.text (topic)));
171
182
// sheet appears onscreen; default duration of bottom-sheet enter animation
172
183
await tester.pump (const Duration (milliseconds: 250 ));
173
- check (find.byType (BottomSheet )).findsOne ();
174
- check (find.text ('Follow topic' )).findsOne ();
184
+ checkButtons ();
175
185
});
176
186
});
177
187
0 commit comments