@@ -43,6 +43,7 @@ void main() {
43
43
..url.path.equals ('/api/v1/messages/$messageId ' )
44
44
..url.queryParameters.deepEquals ({
45
45
if (applyMarkdown != null ) 'apply_markdown' : applyMarkdown.toString (),
46
+ 'allow_empty_topic_name' : 'true' ,
46
47
});
47
48
}
48
49
return result;
@@ -149,7 +150,10 @@ void main() {
149
150
await checkGetMessage (connection,
150
151
messageId: 1 ,
151
152
applyMarkdown: true ,
152
- expected: {'apply_markdown' : 'true' });
153
+ expected: {
154
+ 'apply_markdown' : 'true' ,
155
+ 'allow_empty_topic_name' : 'true' ,
156
+ });
153
157
});
154
158
});
155
159
@@ -159,7 +163,19 @@ void main() {
159
163
await checkGetMessage (connection,
160
164
messageId: 1 ,
161
165
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: {});
163
179
});
164
180
});
165
181
@@ -259,6 +275,7 @@ void main() {
259
275
'anchor' : 'newest' ,
260
276
'num_before' : '10' ,
261
277
'num_after' : '20' ,
278
+ 'allow_empty_topic_name' : 'true' ,
262
279
});
263
280
});
264
281
});
@@ -292,6 +309,22 @@ void main() {
292
309
'anchor' : '42' ,
293
310
'num_before' : '10' ,
294
311
'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' ,
295
328
});
296
329
});
297
330
});
0 commit comments