@@ -21,6 +21,7 @@ import 'package:zulip/widgets/color.dart';
21
21
import 'package:zulip/widgets/content.dart' ;
22
22
import 'package:zulip/widgets/icons.dart' ;
23
23
import 'package:zulip/widgets/message_list.dart' ;
24
+ import 'package:zulip/widgets/page.dart' ;
24
25
import 'package:zulip/widgets/store.dart' ;
25
26
import 'package:zulip/widgets/channel_colors.dart' ;
26
27
@@ -32,8 +33,11 @@ import '../model/test_store.dart';
32
33
import '../flutter_checks.dart' ;
33
34
import '../stdlib_checks.dart' ;
34
35
import '../test_images.dart' ;
36
+ import '../test_navigation.dart' ;
35
37
import 'content_checks.dart' ;
36
38
import 'dialog_checks.dart' ;
39
+ import 'message_list_checks.dart' ;
40
+ import 'page_checks.dart' ;
37
41
import 'test_app.dart' ;
38
42
39
43
void main () {
@@ -51,6 +55,7 @@ void main() {
51
55
List <User >? users,
52
56
List <Subscription >? subscriptions,
53
57
UnreadMessagesSnapshot ? unreadMsgs,
58
+ List <NavigatorObserver > navObservers = const [],
54
59
}) async {
55
60
TypingNotifier .debugEnable = false ;
56
61
addTearDown (TypingNotifier .debugReset);
@@ -72,6 +77,7 @@ void main() {
72
77
eg.newestGetMessagesResult (foundOldest: foundOldest, messages: messages).toJson ());
73
78
74
79
await tester.pumpWidget (TestZulipApp (accountId: eg.selfAccount.id,
80
+ navigatorObservers: navObservers,
75
81
child: MessageListPage (initNarrow: narrow)));
76
82
77
83
// global store, per-account store, and message list get loaded
@@ -126,6 +132,28 @@ void main() {
126
132
});
127
133
});
128
134
135
+ group ('app bar' , () {
136
+ testWidgets ('has channel-feed action for topic narrows' , (tester) async {
137
+ final pushedRoutes = < Route <void >> [];
138
+ final navObserver = TestNavigatorObserver ()
139
+ ..onPushed = (route, prevRoute) => pushedRoutes.add (route);
140
+ final channel = eg.stream ();
141
+ await setupMessageListPage (tester, narrow: TopicNarrow (channel.streamId, 'hi' ),
142
+ navObservers: [navObserver],
143
+ streams: [channel], messageCount: 1 );
144
+
145
+ // Clear out initial route.
146
+ assert (pushedRoutes.length == 1 );
147
+ pushedRoutes.clear ();
148
+
149
+ // Tap button; it works.
150
+ await tester.tap (find.byIcon (ZulipIcons .message_feed));
151
+ check (pushedRoutes).single.isA <WidgetRoute >()
152
+ .page.isA <MessageListPage >().initNarrow
153
+ .equals (ChannelNarrow (channel.streamId));
154
+ });
155
+ });
156
+
129
157
group ('presents message content appropriately' , () {
130
158
testWidgets ('content not asked to consume insets (including bottom), even without compose box' , (tester) async {
131
159
// Regression test for: https://github.com/zulip/zulip-flutter/issues/736
0 commit comments