@@ -19,6 +19,7 @@ import '../flutter_checks.dart';
19
19
import '../model/binding.dart' ;
20
20
import '../model/test_store.dart' ;
21
21
import '../test_navigation.dart' ;
22
+ import 'finders.dart' ;
22
23
import 'test_app.dart' ;
23
24
24
25
late PerAccountStore store;
@@ -125,23 +126,23 @@ void main() {
125
126
126
127
testWidgets ('shows all non-muted users initially' , (tester) async {
127
128
await setupSheet (tester, users: testUsers, mutedUserIds: [mutedUser.userId]);
128
- check (find. textContaining ( 'Alice Anderson' )).findsOne ();
129
- check (find. textContaining ( 'Bob Brown' )).findsOne ();
130
- check (find. textContaining ( 'Charlie Carter' )).findsOne ();
129
+ check (findText (includePlaceholders : false , 'Alice Anderson' )).findsOne ();
130
+ check (findText (includePlaceholders : false , 'Bob Brown' )).findsOne ();
131
+ check (findText (includePlaceholders : false , 'Charlie Carter' )).findsOne ();
131
132
132
133
check (find.byIcon (ZulipIcons .check_circle_unchecked)).findsExactly (3 );
133
134
check (find.byIcon (ZulipIcons .check_circle_checked)).findsNothing ();
134
- check (find. textContaining ( 'Someone Muted' )).findsNothing ();
135
- check (find. textContaining ( 'Muted user' )).findsNothing ();
135
+ check (findText (includePlaceholders : false , 'Someone Muted' )).findsNothing ();
136
+ check (findText (includePlaceholders : false , 'Muted user' )).findsNothing ();
136
137
});
137
138
138
139
testWidgets ('shows filtered users based on search' , (tester) async {
139
140
await setupSheet (tester, users: testUsers);
140
141
await tester.enterText (find.byType (TextField ), 'Alice' );
141
142
await tester.pump ();
142
- check (find. textContaining ( 'Alice Anderson' )).findsOne ();
143
- check (find. textContaining ( 'Charlie Carter' )).findsNothing ();
144
- check (find. textContaining ( 'Bob Brown' )).findsNothing ();
143
+ check (findText (includePlaceholders : false , 'Alice Anderson' )).findsOne ();
144
+ check (findText (includePlaceholders : false , 'Charlie Carter' )).findsNothing ();
145
+ check (findText (includePlaceholders : false , 'Bob Brown' )).findsNothing ();
145
146
});
146
147
147
148
// TODO test sorting by recent-DMs
@@ -151,43 +152,43 @@ void main() {
151
152
await setupSheet (tester, users: testUsers);
152
153
await tester.enterText (find.byType (TextField ), 'alice' );
153
154
await tester.pump ();
154
- check (find. textContaining ( 'Alice Anderson' )).findsOne ();
155
+ check (findText (includePlaceholders : false , 'Alice Anderson' )).findsOne ();
155
156
156
157
await tester.enterText (find.byType (TextField ), 'ALICE' );
157
158
await tester.pump ();
158
- check (find. textContaining ( 'Alice Anderson' )).findsOne ();
159
+ check (findText (includePlaceholders : false , 'Alice Anderson' )).findsOne ();
159
160
});
160
161
161
162
testWidgets ('partial name and last name search handling' , (tester) async {
162
163
await setupSheet (tester, users: testUsers);
163
164
164
165
await tester.enterText (find.byType (TextField ), 'Ali' );
165
166
await tester.pump ();
166
- check (find. textContaining ( 'Alice Anderson' )).findsOne ();
167
- check (find. textContaining ( 'Bob Brown' )).findsNothing ();
168
- check (find. textContaining ( 'Charlie Carter' )).findsNothing ();
167
+ check (findText (includePlaceholders : false , 'Alice Anderson' )).findsOne ();
168
+ check (findText (includePlaceholders : false , 'Bob Brown' )).findsNothing ();
169
+ check (findText (includePlaceholders : false , 'Charlie Carter' )).findsNothing ();
169
170
170
171
await tester.enterText (find.byType (TextField ), 'Anderson' );
171
172
await tester.pump ();
172
- check (find. textContaining ( 'Alice Anderson' )).findsOne ();
173
- check (find. textContaining ( 'Charlie Carter' )).findsNothing ();
174
- check (find. textContaining ( 'Bob Brown' )).findsNothing ();
173
+ check (findText (includePlaceholders : false , 'Alice Anderson' )).findsOne ();
174
+ check (findText (includePlaceholders : false , 'Charlie Carter' )).findsNothing ();
175
+ check (findText (includePlaceholders : false , 'Bob Brown' )).findsNothing ();
175
176
176
177
await tester.enterText (find.byType (TextField ), 'son' );
177
178
await tester.pump ();
178
- check (find. textContaining ( 'Alice Anderson' )).findsOne ();
179
- check (find. textContaining ( 'Charlie Carter' )).findsNothing ();
180
- check (find. textContaining ( 'Bob Brown' )).findsNothing ();
179
+ check (findText (includePlaceholders : false , 'Alice Anderson' )).findsOne ();
180
+ check (findText (includePlaceholders : false , 'Charlie Carter' )).findsNothing ();
181
+ check (findText (includePlaceholders : false , 'Bob Brown' )).findsNothing ();
181
182
});
182
183
183
184
testWidgets ('shows empty state when no users match' , (tester) async {
184
185
await setupSheet (tester, users: testUsers);
185
186
await tester.enterText (find.byType (TextField ), 'Zebra' );
186
187
await tester.pump ();
187
- check (find. textContaining ( 'No users found' )).findsOne ();
188
- check (find. textContaining ( 'Alice Anderson' )).findsNothing ();
189
- check (find. textContaining ( 'Bob Brown' )).findsNothing ();
190
- check (find. textContaining ( 'Charlie Carter' )).findsNothing ();
188
+ check (findText (includePlaceholders : false , 'No users found' )).findsOne ();
189
+ check (findText (includePlaceholders : false , 'Alice Anderson' )).findsNothing ();
190
+ check (findText (includePlaceholders : false , 'Bob Brown' )).findsNothing ();
191
+ check (findText (includePlaceholders : false , 'Charlie Carter' )).findsNothing ();
191
192
});
192
193
193
194
testWidgets ('search text clears when user is selected' , (tester) async {
0 commit comments