@@ -583,7 +583,13 @@ void main() {
583
583
const topic = 'topic' ;
584
584
final topicNarrow = TopicNarrow (stream.streamId, topic);
585
585
586
- final users = List .generate (5 , (i) => eg.user (userId: 1 + i));
586
+ final users = [
587
+ eg.user (userId: 1 , fullName: 'User One' ),
588
+ eg.user (userId: 2 , fullName: 'User Two' ),
589
+ eg.user (userId: 3 , fullName: 'User Three' ),
590
+ eg.user (userId: 4 , fullName: 'User Four' ),
591
+ eg.user (userId: 5 , fullName: 'User Five' ),
592
+ ];
587
593
588
594
final dmConversations = [
589
595
RecentDmConversation (userIds: [4 ], maxMessageId: 300 ),
@@ -630,8 +636,14 @@ void main() {
630
636
631
637
await prepareStore ();
632
638
await fetchInitialMessagesIn (topicNarrow);
639
+ // Check the ranking of the full list of users.
633
640
check (await getResults (topicNarrow, MentionAutocompleteQuery ('' )))
634
641
.deepEquals ([1 , 5 , 4 , 2 , 3 ]);
642
+ // Check the ranking applies also to results filtered by a query.
643
+ check (await getResults (topicNarrow, MentionAutocompleteQuery ('t' )))
644
+ .deepEquals ([2 , 3 ]);
645
+ check (await getResults (topicNarrow, MentionAutocompleteQuery ('f' )))
646
+ .deepEquals ([5 , 4 ]);
635
647
});
636
648
});
637
649
}
0 commit comments