Skip to content

Commit e51d2f2

Browse files
committed
autocomplete test: Tighten up "final results" test
The recent changes that added two new ranking criteria added four new users to this test case. Two is enough to make the test's point, because it's enough for adding users that differ on the new criteria while tying on the criteria that have higher priority in the ranking.
1 parent 093eaba commit e51d2f2

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

test/model/autocomplete_test.dart

+2-8
Original file line numberDiff line numberDiff line change
@@ -705,8 +705,6 @@ void main() {
705705
eg.user(userId: 5, fullName: 'User Five'),
706706
eg.user(userId: 6, fullName: 'User Six', isBot: true),
707707
eg.user(userId: 7, fullName: 'User Seven'),
708-
eg.user(userId: 8, fullName: 'User Xy', isBot: true),
709-
eg.user(userId: 9, fullName: 'User Xz', isBot: true),
710708
];
711709

712710
await prepare(users: users, messages: [
@@ -723,19 +721,15 @@ void main() {
723721
// 1. Users most recent in the current topic/stream.
724722
// 2. Users most recent in the DM conversations.
725723
// 3. Human vs. Bot users (human users come first).
726-
// 4. Alphabetical order.
724+
// 4. Alphabetical order by name.
727725
check(await getResults(topicNarrow, MentionAutocompleteQuery('')))
728-
.deepEquals([1, 5, 4, 2, 7, 3, 6, 8, 9]);
726+
.deepEquals([1, 5, 4, 2, 7, 3, 6]);
729727

730728
// Check the ranking applies also to results filtered by a query.
731729
check(await getResults(topicNarrow, MentionAutocompleteQuery('t')))
732730
.deepEquals([2, 3]);
733731
check(await getResults(topicNarrow, MentionAutocompleteQuery('f')))
734732
.deepEquals([5, 4]);
735-
check(await getResults(topicNarrow, MentionAutocompleteQuery('s')))
736-
.deepEquals([7, 6]);
737-
check(await getResults(topicNarrow, MentionAutocompleteQuery('user x')))
738-
.deepEquals([8, 9]);
739733
});
740734
});
741735
}

0 commit comments

Comments
 (0)