@@ -9,8 +9,10 @@ import 'package:zulip/widgets/color.dart';
99import 'package:zulip/widgets/home.dart' ;
1010import 'package:zulip/widgets/icons.dart' ;
1111import 'package:zulip/widgets/channel_colors.dart' ;
12+ import 'package:zulip/widgets/message_list.dart' ;
1213import 'package:zulip/widgets/unread_count_badge.dart' ;
1314
15+ import '../api/fake_api.dart' ;
1416import '../example_data.dart' as eg;
1517import '../flutter_checks.dart' ;
1618import '../model/binding.dart' ;
@@ -206,8 +208,42 @@ void main() {
206208 await setupVarious (tester);
207209 });
208210
209- // TODO test that tapping a conversation row opens the message list
210- // for the conversation
211+ group ('navigation' , () {
212+ testWidgets ('tapping a topic row opens the message list' , (tester) async {
213+ final stream = eg.stream ();
214+ final subscription = eg.subscription (stream);
215+ const topic = 'lunch' ;
216+ final message = eg.streamMessage (stream: stream, topic: topic);
217+
218+ await setupPage (tester,
219+ streams: [stream],
220+ subscriptions: [subscription],
221+ unreadMessages: [message]);
222+
223+ final connection = store.connection as FakeApiConnection ;
224+
225+ connection.prepare (
226+ json: eg.newestGetMessagesResult (messages: [
227+ eg.streamMessage (stream: stream, topic: topic,
228+ flags: [MessageFlag .read]),
229+ ], foundOldest: false ).toJson (),
230+ );
231+
232+ connection.prepare (
233+ json: eg.newestGetMessagesResult (messages: [], foundOldest: true ).toJson (),
234+ );
235+
236+ await tester.tap (find.text (topic));
237+ await tester.pumpAndSettle ();
238+
239+ check (find.byType (HomePage )).findsNothing ();
240+ check (find.byType (MessageListPage )).findsOne ();
241+
242+ check (find.text (topic)).findsAny ();
243+
244+ });
245+
246+ });
211247
212248 // Tests for the topic action sheet are in test/widgets/action_sheet_test.dart.
213249
0 commit comments