@@ -224,7 +224,7 @@ void main() {
224
224
test ('MentionAutocompleteView yield between batches of 1000' , () async {
225
225
const narrow = ChannelNarrow (1 );
226
226
final store = eg.store ();
227
- for (int i = 0 ; i < 2500 ; i++ ) {
227
+ for (int i = 1 ; i <= 2500 ; i++ ) {
228
228
await store.addUser (eg.user (userId: i, email: 'user$i @example.com' , fullName: 'User $i ' ));
229
229
}
230
230
final view = MentionAutocompleteView .init (store: store, narrow: narrow);
@@ -247,7 +247,7 @@ void main() {
247
247
test ('MentionAutocompleteView new query during computation replaces old' , () async {
248
248
const narrow = ChannelNarrow (1 );
249
249
final store = eg.store ();
250
- for (int i = 0 ; i < 1500 ; i++ ) {
250
+ for (int i = 1 ; i <= 1500 ; i++ ) {
251
251
await store.addUser (eg.user (userId: i, email: 'user$i @example.com' , fullName: 'User $i ' ));
252
252
}
253
253
final view = MentionAutocompleteView .init (store: store, narrow: narrow);
@@ -258,7 +258,7 @@ void main() {
258
258
259
259
await Future (() {});
260
260
check (done).isFalse ();
261
- view.query = MentionAutocompleteQuery ('User 0 ' );
261
+ view.query = MentionAutocompleteQuery ('User 234 ' );
262
262
263
263
// …new query goes through all batches
264
264
await Future (() {});
@@ -267,22 +267,22 @@ void main() {
267
267
check (done).isTrue (); // new result is set
268
268
check (view.results).single
269
269
.isA <UserMentionAutocompleteResult >()
270
- .userId.equals (0 );
270
+ .userId.equals (234 );
271
271
272
272
// new result sticks; it isn't clobbered with old query's result
273
273
for (int i = 0 ; i < 10 ; i++ ) { // for good measure
274
274
await Future (() {});
275
275
check (view.results).single
276
276
.isA <UserMentionAutocompleteResult >()
277
- .userId.equals (0 );
277
+ .userId.equals (234 );
278
278
}
279
279
});
280
280
281
281
test ('MentionAutocompleteView mutating store.users while in progress does not '
282
282
'prevent query from finishing' , () async {
283
283
const narrow = ChannelNarrow (1 );
284
284
final store = eg.store ();
285
- for (int i = 0 ; i < 2500 ; i++ ) {
285
+ for (int i = 1 ; i <= 2500 ; i++ ) {
286
286
await store.addUser (eg.user (userId: i, email: 'user$i @example.com' , fullName: 'User $i ' ));
287
287
}
288
288
final view = MentionAutocompleteView .init (store: store, narrow: narrow);
0 commit comments