@@ -334,8 +334,8 @@ void main() {
334
334
});
335
335
336
336
group ('TopicAutocomplete' , () {
337
- void checkTopicShown (GetStreamTopicsEntry topic, PerAccountStore store, {required bool expected}) {
338
- check (find.text (topic.name.displayName ).evaluate ().length).equals (expected ? 1 : 0 );
337
+ void checkTopicShown (String topic, PerAccountStore store, {required bool expected}) {
338
+ check (find.text (topic).evaluate ().length).equals (expected ? 1 : 0 );
339
339
}
340
340
341
341
testWidgets ('options appear, disappear, and change correctly' , (WidgetTester tester) async {
@@ -352,24 +352,24 @@ void main() {
352
352
await tester.pumpAndSettle ();
353
353
354
354
// "topic three" and "topic two" appear, but not "topic one"
355
- checkTopicShown (topic1, store, expected: false );
356
- checkTopicShown (topic2, store, expected: true );
357
- checkTopicShown (topic3 , store, expected: true );
355
+ checkTopicShown ('Topic one' , store, expected: false );
356
+ checkTopicShown ('Topic two' , store, expected: true );
357
+ checkTopicShown ('Topic three' , store, expected: true );
358
358
359
359
// Finishing autocomplete updates topic box; causes options to disappear
360
360
await tester.tap (find.text ('Topic three' ));
361
361
await tester.pumpAndSettle ();
362
362
check (tester.widget <TextField >(topicInputFinder).controller! .text)
363
363
.equals (topic3.name.displayName);
364
- checkTopicShown (topic1, store, expected: false );
365
- checkTopicShown (topic2, store, expected: false );
366
- checkTopicShown (topic3 , store, expected: true ); // shown in `_TopicInput` once
364
+ checkTopicShown ('Topic one' , store, expected: false );
365
+ checkTopicShown ('Topic two' , store, expected: false );
366
+ checkTopicShown ('Topic three' , store, expected: true ); // shown in `_TopicInput` once
367
367
368
368
// Then a new autocomplete intent brings up options again
369
369
await tester.enterText (topicInputFinder, 'Topic' );
370
370
await tester.enterText (topicInputFinder, 'Topic T' );
371
371
await tester.pumpAndSettle ();
372
- checkTopicShown (topic2 , store, expected: true );
372
+ checkTopicShown ('Topic two' , store, expected: true );
373
373
});
374
374
375
375
testWidgets ('text selection is reset on choosing an option' , (tester) async {
0 commit comments