Skip to content

Commit 3c7096f

Browse files
committed
autocomplete test [nfc]: Tighten formatting in compareByRecency tests
1 parent a0d0248 commit 3c7096f

File tree

1 file changed

+5
-21
lines changed

1 file changed

+5
-21
lines changed

test/model/autocomplete_test.dart

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -395,44 +395,28 @@ void main() {
395395
const topic2 = 'topic2';
396396

397397
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);
403399
}
404400

405401
int compareAB({required String? topic}) {
406402
return MentionAutocompleteView.compareByRecency(userA, userB,
407-
streamId: stream.streamId,
408-
topic: topic,
409-
store: store,
410-
);
403+
streamId: stream.streamId, topic: topic, store: store);
411404
}
412405

413406
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)]);
418408
check(compareAB(topic: topic1)).isGreaterThan(0);
419409
});
420410

421411
test('no activity in topic -> prioritizes the user with more recent '
422412
'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)]);
427414
check(compareAB(topic: topic2)).isGreaterThan(0);
428415
});
429416

430417
test('no topic provided -> prioritizes the user with more recent '
431418
'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)]);
436420
check(compareAB(topic: null)).isGreaterThan(0);
437421
});
438422

0 commit comments

Comments
 (0)