@@ -254,19 +254,19 @@ void main() {
254254 });
255255
256256 group ('user selection' , () {
257- void checkUserSelected (WidgetTester tester, User user, bool expected) {
258- final icon = tester.widget <Icon >(find.descendant (
259- of: findUserTile (user),
260- matching: find.byType (Icon )));
261-
262- if (expected) {
263- check (findUserChip (user)).findsOne ();
264- check (icon).icon.equals (ZulipIcons .check_circle_checked);
265- } else {
266- check (findUserChip (user)).findsNothing ();
267- check (icon).icon.equals (ZulipIcons .check_circle_unchecked);
257+ Finder findInUserTile (User user, Finder finder) => find.descendant (of: findUserTile (user), matching: finder);
258+
259+ void checkUserSelected (WidgetTester tester, User user, bool expected) {
260+ if (expected) {
261+ check (findUserChip (user)).findsOne ();
262+ check (findInUserTile (user,find.byIcon (ZulipIcons .check_circle_checked))).findsOne ();
263+ check (findInUserTile (user,find.byIcon (ZulipIcons .check_circle_unchecked))).findsNothing ();
264+ } else {
265+ check (findUserChip (user)).findsNothing ();
266+ check (findInUserTile (user,find.byIcon (ZulipIcons .check_circle_unchecked))).findsOne ();
267+ check (findInUserTile (user,find.byIcon (ZulipIcons .check_circle_checked))).findsNothing ();
268+ }
268269 }
269- }
270270
271271 testWidgets ('tapping user chip deselects the user' , (tester) async {
272272 await setupSheet (tester, users: [eg.otherUser, eg.thirdUser]);
0 commit comments