Skip to content

Commit d673c5f

Browse files
committed
autocomplete test [nfc]: Add and use isTopic condition
1 parent 390b6d3 commit d673c5f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/model/autocomplete_test.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,6 +1233,10 @@ void main() {
12331233
doTest('a^bc^', TopicAutocompleteQuery('abc'));
12341234
});
12351235

1236+
Condition<Object?> isTopic(TopicName topic) {
1237+
return (it) => it.isA<TopicAutocompleteResult>().topic.equals(topic);
1238+
}
1239+
12361240
test('TopicAutocompleteView misc', () async {
12371241
final store = eg.store();
12381242
final connection = store.connection as FakeApiConnection;
@@ -1253,9 +1257,7 @@ void main() {
12531257
await Future(() {});
12541258
await Future(() {});
12551259
check(done).isTrue();
1256-
check(view.results).single
1257-
.isA<TopicAutocompleteResult>()
1258-
.topic.equals(third.name);
1260+
check(view.results).single.which(isTopic(third.name));
12591261
});
12601262

12611263
test('TopicAutocompleteView updates results when topics are loaded', () async {

0 commit comments

Comments
 (0)