@@ -21,7 +21,6 @@ import '../api/fake_api.dart';
2121import '../example_data.dart' as eg;
2222import '../flutter_checks.dart' ;
2323import '../model/binding.dart' ;
24- import '../model/unreads_checks.dart' ;
2524import '../stdlib_checks.dart' ;
2625import '../test_clipboard.dart' ;
2726import 'dialog_checks.dart' ;
@@ -119,106 +118,6 @@ void main() {
119118 await future;
120119 check (store.unreads.oldUnreadsMissing).isFalse ();
121120 });
122-
123- testWidgets ('CombinedFeedNarrow on legacy server' , (tester) async {
124- const narrow = CombinedFeedNarrow ();
125- await prepare (tester);
126- // Might as well test with oldUnreadsMissing: true.
127- store.unreads.oldUnreadsMissing = true ;
128-
129- connection.zulipFeatureLevel = 154 ;
130- connection.prepare (json: {});
131- final future = ZulipAction .markNarrowAsRead (context, narrow);
132- await tester.pump (Duration .zero);
133- await future;
134- check (connection.lastRequest).isA< http.Request > ()
135- ..method.equals ('POST' )
136- ..url.path.equals ('/api/v1/mark_all_as_read' )
137- ..bodyFields.deepEquals ({});
138-
139- // Check that [Unreads.handleAllMessagesReadSuccess] wasn't called;
140- // in the legacy protocol, that'd be redundant with the mark-read event.
141- check (store.unreads).oldUnreadsMissing.isTrue ();
142- });
143-
144- testWidgets ('ChannelNarrow on legacy server' , (tester) async {
145- final stream = eg.stream ();
146- final narrow = ChannelNarrow (stream.streamId);
147- await prepare (tester);
148- connection.zulipFeatureLevel = 154 ;
149- connection.prepare (json: {});
150- final future = ZulipAction .markNarrowAsRead (context, narrow);
151- await tester.pump (Duration .zero);
152- await future;
153- check (connection.lastRequest).isA< http.Request > ()
154- ..method.equals ('POST' )
155- ..url.path.equals ('/api/v1/mark_stream_as_read' )
156- ..bodyFields.deepEquals ({
157- 'stream_id' : stream.streamId.toString (),
158- });
159- });
160-
161- testWidgets ('TopicNarrow on legacy server' , (tester) async {
162- final narrow = TopicNarrow .ofMessage (eg.streamMessage ());
163- await prepare (tester);
164- connection.zulipFeatureLevel = 154 ;
165- connection.prepare (json: {});
166- final future = ZulipAction .markNarrowAsRead (context, narrow);
167- await tester.pump (Duration .zero);
168- await future;
169- check (connection.lastRequest).isA< http.Request > ()
170- ..method.equals ('POST' )
171- ..url.path.equals ('/api/v1/mark_topic_as_read' )
172- ..bodyFields.deepEquals ({
173- 'stream_id' : narrow.streamId.toString (),
174- 'topic_name' : narrow.topic,
175- });
176- });
177-
178- testWidgets ('DmNarrow on legacy server' , (tester) async {
179- final message = eg.dmMessage (from: eg.otherUser, to: [eg.selfUser]);
180- final narrow = DmNarrow .ofMessage (message, selfUserId: eg.selfUser.userId);
181- final unreadMsgs = eg.unreadMsgs (dms: [
182- UnreadDmSnapshot (otherUserId: eg.otherUser.userId,
183- unreadMessageIds: [message.id]),
184- ]);
185- await prepare (tester, unreadMsgs: unreadMsgs);
186- connection.zulipFeatureLevel = 154 ;
187- connection.prepare (json:
188- UpdateMessageFlagsResult (messages: [message.id]).toJson ());
189- final future = ZulipAction .markNarrowAsRead (context, narrow);
190- await tester.pump (Duration .zero);
191- await future;
192- check (connection.lastRequest).isA< http.Request > ()
193- ..method.equals ('POST' )
194- ..url.path.equals ('/api/v1/messages/flags' )
195- ..bodyFields.deepEquals ({
196- 'messages' : jsonEncode ([message.id]),
197- 'op' : 'add' ,
198- 'flag' : 'read' ,
199- });
200- });
201-
202- testWidgets ('MentionsNarrow on legacy server' , (tester) async {
203- const narrow = MentionsNarrow ();
204- final message = eg.streamMessage (flags: [MessageFlag .mentioned]);
205- final unreadMsgs = eg.unreadMsgs (mentions: [message.id]);
206- await prepare (tester, unreadMsgs: unreadMsgs);
207- connection.zulipFeatureLevel = 154 ;
208- connection.prepare (json:
209- UpdateMessageFlagsResult (messages: [message.id]).toJson ());
210- final future = ZulipAction .markNarrowAsRead (context, narrow);
211- await tester.pump (Duration .zero);
212- await future;
213- check (connection.lastRequest).isA< http.Request > ()
214- ..method.equals ('POST' )
215- ..url.path.equals ('/api/v1/messages/flags' )
216- ..bodyFields.deepEquals ({
217- 'messages' : jsonEncode ([message.id]),
218- 'op' : 'add' ,
219- 'flag' : 'read' ,
220- });
221- });
222121 });
223122
224123 group ('updateMessageFlagsStartingFromAnchor' , () {
0 commit comments