@@ -351,6 +351,9 @@ void main() {
351
351
352
352
final searchFieldFinder = find.widgetWithText (TextField , 'Search emoji' );
353
353
354
+ Finder findInPicker (Finder finder) =>
355
+ find.descendant (of: find.byType (EmojiPicker ), matching: finder);
356
+
354
357
Condition <Object ?> conditionEmojiListEntry ({
355
358
required ReactionType emojiType,
356
359
required String emojiCode,
@@ -429,9 +432,7 @@ void main() {
429
432
await setupEmojiPicker (tester, message: message, narrow: TopicNarrow .ofMessage (message));
430
433
431
434
connection.prepare (json: {});
432
- await tester.tap (find.descendant (
433
- of: find.byType (BottomSheet ),
434
- matching: find.text ('\u {1f4a4}' ))); // 'zzz' emoji
435
+ await tester.tap (findInPicker (find.text ('\u {1f4a4}' ))); // 'zzz' emoji
435
436
await tester.pump (Duration .zero);
436
437
437
438
check (connection.lastRequest).isA< http.Request > ()
@@ -453,9 +454,8 @@ void main() {
453
454
connection.prepare (
454
455
delay: const Duration (seconds: 2 ),
455
456
apiException: eg.apiBadRequest (message: 'Invalid message(s)' ));
456
- await tester.tap (find.descendant (
457
- of: find.byType (BottomSheet ),
458
- matching: find.text ('\u {1f4a4}' ))); // 'zzz' emoji
457
+
458
+ await tester.tap (findInPicker (find.text ('\u {1f4a4}' ))); // 'zzz' emoji
459
459
await tester.pump (); // register tap
460
460
await tester.pump (const Duration (seconds: 1 )); // emoji picker animates away
461
461
await tester.pump (const Duration (seconds: 1 )); // error arrives; error dialog shows
0 commit comments