@@ -43,6 +43,7 @@ void main() {
4343          ..url.path.equals ('/api/v1/messages/$messageId ' )
4444          ..url.queryParameters.deepEquals ({
4545            if  (applyMarkdown !=  null ) 'apply_markdown' :  applyMarkdown.toString (),
46+             'allow_empty_topic_name' :  'true' ,
4647          });
4748      }
4849      return  result;
@@ -149,7 +150,10 @@ void main() {
149150        await  checkGetMessage (connection,
150151          messageId:  1 ,
151152          applyMarkdown:  true ,
152-           expected:  {'apply_markdown' :  'true' });
153+           expected:  {
154+             'apply_markdown' :  'true' ,
155+             'allow_empty_topic_name' :  'true' ,
156+           });
153157      });
154158    });
155159
@@ -159,7 +163,19 @@ void main() {
159163        await  checkGetMessage (connection,
160164          messageId:  1 ,
161165          applyMarkdown:  false ,
162-           expected:  {'apply_markdown' :  'false' });
166+           expected:  {
167+             'apply_markdown' :  'false' ,
168+             'allow_empty_topic_name' :  'true' ,
169+           });
170+       });
171+     });
172+ 
173+     test ('legacy: empty topic name not supported' , () {
174+       return  FakeApiConnection .with_ (zulipFeatureLevel:  333 , (connection) async  {
175+         connection.prepare (json:  fakeResult.toJson ());
176+         await  checkGetMessage (connection,
177+           messageId:  1 ,
178+           expected:  {});
163179      });
164180    });
165181
@@ -259,6 +275,7 @@ void main() {
259275            'anchor' :  'newest' ,
260276            'num_before' :  '10' ,
261277            'num_after' :  '20' ,
278+             'allow_empty_topic_name' :  'true' ,
262279          });
263280      });
264281    });
@@ -292,6 +309,22 @@ void main() {
292309            'anchor' :  '42' ,
293310            'num_before' :  '10' ,
294311            'num_after' :  '20' ,
312+             'allow_empty_topic_name' :  'true' ,
313+           });
314+       });
315+     });
316+ 
317+     test ('legacy: empty topic name not supported' , () {
318+       return  FakeApiConnection .with_ (zulipFeatureLevel:  333 , (connection) async  {
319+         connection.prepare (json:  fakeResult.toJson ());
320+         await  checkGetMessages (connection,
321+           narrow:  const  CombinedFeedNarrow ().apiEncode (),
322+           anchor:  AnchorCode .newest, numBefore:  10 , numAfter:  20 ,
323+           expected:  {
324+             'narrow' :  jsonEncode ([]),
325+             'anchor' :  'newest' ,
326+             'num_before' :  '10' ,
327+             'num_after' :  '20' ,
295328          });
296329      });
297330    });
0 commit comments