@@ -182,6 +182,17 @@ void main() {
182
182
));
183
183
}
184
184
185
+ bool hasIcon (WidgetTester tester, {
186
+ required Widget ? parent,
187
+ required IconData icon,
188
+ }) {
189
+ check (parent).isNotNull ();
190
+ return tester.widgetList (find.descendant (
191
+ of: find.byWidget (parent! ),
192
+ matching: find.byIcon (icon),
193
+ )).isNotEmpty;
194
+ }
195
+
185
196
group ('InboxPage' , () {
186
197
testWidgets ('page builds; empty' , (tester) async {
187
198
await setupPage (tester, unreadMessages: []);
@@ -246,13 +257,8 @@ void main() {
246
257
final subscription = eg.subscription (stream);
247
258
const topic = 'lunch' ;
248
259
249
- bool hasAtSign (WidgetTester tester, Widget ? parent) {
250
- check (parent).isNotNull ();
251
- return tester.widgetList (find.descendant (
252
- of: find.byWidget (parent! ),
253
- matching: find.byIcon (ZulipIcons .at_sign),
254
- )).isNotEmpty;
255
- }
260
+ bool hasAtSign (WidgetTester tester, Widget ? parent) =>
261
+ hasIcon (tester, parent: parent, icon: ZulipIcons .at_sign);
256
262
257
263
testWidgets ('topic with a mention' , (tester) async {
258
264
await setupPage (tester,
0 commit comments