Skip to content

Commit d91ecca

Browse files
committed
autocomplete test: Check compareByRecency uses per-topic recency
Without this, the method's other unit tests (the other tests in this group) pass even if the method were to ignore its `topic` parameter and only use the per-stream data.
1 parent 6e72a5b commit d91ecca

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/model/autocomplete_test.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,12 @@ void main() {
416416
check(compareAB(topic: topic1)).isGreaterThan(0);
417417
});
418418

419+
test('favor most recent in topic ahead of most recent in stream', () async {
420+
await prepare(messages: [
421+
message(userA, topic1), message(userB, topic1), message(userA, topic2)]);
422+
check(compareAB(topic: topic1)).isGreaterThan(0);
423+
});
424+
419425
test('no activity in topic -> favor user most recent in stream', () async {
420426
await prepare(messages: [message(userA, topic1), message(userB, topic1)]);
421427
check(compareAB(topic: topic2)).isGreaterThan(0);

0 commit comments

Comments
 (0)