@@ -138,15 +138,9 @@ void main () {
138
138
group ('menu' , () {
139
139
final designVariables = DesignVariables .light;
140
140
141
- final inboxMenuIconFinder = find.descendant (
142
- of: find.byType (BottomSheet ),
143
- matching: find.byIcon (ZulipIcons .inbox));
144
- final channelsMenuIconFinder = find.descendant (
145
- of: find.byType (BottomSheet ),
146
- matching: find.byIcon (ZulipIcons .hash_italic));
147
- final combinedFeedMenuIconFinder = find.descendant (
148
- of: find.byType (BottomSheet ),
149
- matching: find.byIcon (ZulipIcons .message_feed));
141
+ final inboxMenuIconFinder = find.byIcon (ZulipIcons .inbox);
142
+ final channelsMenuIconFinder = find.byIcon (ZulipIcons .hash_italic);
143
+ final combinedFeedMenuIconFinder = find.byIcon (ZulipIcons .message_feed);
150
144
151
145
Future <void > tapOpenMenu (WidgetTester tester) async {
152
146
await tester.tap (find.byIcon (ZulipIcons .menu));
@@ -156,12 +150,18 @@ void main () {
156
150
}
157
151
158
152
void checkIconSelected (WidgetTester tester, Finder finder) {
159
- check (tester.widget (finder)).isA <Icon >().color.isNotNull ()
153
+ final widget = tester.widget (find.descendant (
154
+ of: find.byType (BottomSheet ),
155
+ matching: finder));
156
+ check (widget).isA <Icon >().color.isNotNull ()
160
157
.isSameColorAs (designVariables.iconSelected);
161
158
}
162
159
163
160
void checkIconNotSelected (WidgetTester tester, Finder finder) {
164
- check (tester.widget (finder)).isA <Icon >().color.isNotNull ()
161
+ final widget = tester.widget (find.descendant (
162
+ of: find.byType (BottomSheet ),
163
+ matching: finder));
164
+ check (widget).isA <Icon >().color.isNotNull ()
165
165
.isSameColorAs (designVariables.icon);
166
166
}
167
167
@@ -192,7 +192,9 @@ void main () {
192
192
check (find.byType (InboxPageBody )).findsOne ();
193
193
check (find.byType (SubscriptionListPageBody )).findsNothing ();
194
194
195
- await tester.tap (channelsMenuIconFinder);
195
+ await tester.tap (find.descendant (
196
+ of: find.byType (BottomSheet ),
197
+ matching: channelsMenuIconFinder));
196
198
await tester.pump (Duration .zero); // tap the button
197
199
await tester.pump (const Duration (milliseconds: 250 )); // wait for animation
198
200
check (find.byType (BottomSheet )).findsNothing ();
@@ -208,7 +210,9 @@ void main () {
208
210
await prepare (tester);
209
211
await tapOpenMenu (tester);
210
212
211
- await tester.tap (channelsMenuIconFinder);
213
+ await tester.tap (find.descendant (
214
+ of: find.byType (BottomSheet ),
215
+ matching: channelsMenuIconFinder));
212
216
await tester.pump (Duration .zero); // tap the button
213
217
await tester.pump (const Duration (milliseconds: 250 )); // wait for animation
214
218
check (find.byType (BottomSheet )).findsNothing ();
@@ -237,7 +241,9 @@ void main () {
237
241
238
242
connection.prepare (json: eg.newestGetMessagesResult (
239
243
foundOldest: true , messages: [eg.streamMessage ()]).toJson ());
240
- await tester.tap (combinedFeedMenuIconFinder);
244
+ await tester.tap (find.descendant (
245
+ of: find.byType (BottomSheet ),
246
+ matching: combinedFeedMenuIconFinder));
241
247
await tester.pump (Duration .zero); // tap the button
242
248
await tester.pump (const Duration (milliseconds: 250 )); // wait for animation
243
249
0 commit comments