@@ -395,44 +395,28 @@ void main() {
395
395
const topic2 = 'topic2' ;
396
396
397
397
Message message (User sender, String topic) {
398
- return eg.streamMessage (
399
- sender: sender,
400
- stream: stream,
401
- topic: topic,
402
- );
398
+ return eg.streamMessage (sender: sender, stream: stream, topic: topic);
403
399
}
404
400
405
401
int compareAB ({required String ? topic}) {
406
402
return MentionAutocompleteView .compareByRecency (userA, userB,
407
- streamId: stream.streamId,
408
- topic: topic,
409
- store: store,
410
- );
403
+ streamId: stream.streamId, topic: topic, store: store);
411
404
}
412
405
413
406
test ('prioritizes the user with more recent activity in the topic' , () async {
414
- await prepare (messages: [
415
- message (userA, topic1),
416
- message (userB, topic1),
417
- ]);
407
+ await prepare (messages: [message (userA, topic1), message (userB, topic1)]);
418
408
check (compareAB (topic: topic1)).isGreaterThan (0 );
419
409
});
420
410
421
411
test ('no activity in topic -> prioritizes the user with more recent '
422
412
'activity in the stream' , () async {
423
- await prepare (messages: [
424
- message (userA, topic1),
425
- message (userB, topic1),
426
- ]);
413
+ await prepare (messages: [message (userA, topic1), message (userB, topic1)]);
427
414
check (compareAB (topic: topic2)).isGreaterThan (0 );
428
415
});
429
416
430
417
test ('no topic provided -> prioritizes the user with more recent '
431
418
'activity in the stream' , () async {
432
- await prepare (messages: [
433
- message (userA, topic1),
434
- message (userB, topic2),
435
- ]);
419
+ await prepare (messages: [message (userA, topic1), message (userB, topic2)]);
436
420
check (compareAB (topic: null )).isGreaterThan (0 );
437
421
});
438
422
0 commit comments