@@ -169,13 +169,20 @@ void main() {
169169 });
170170 });
171171
172- test ('Narrow .toJson' , () {
172+ test ('ApiNarrow .toJson' , () {
173173 return FakeApiConnection .with_ ((connection) async {
174174 void checkNarrow (ApiNarrow narrow, String expected) {
175175 narrow = resolveApiNarrowForServer (narrow, connection.zulipFeatureLevel! );
176176 check (jsonEncode (narrow)).equals (expected);
177177 }
178178
179+ checkNarrow (const MentionsNarrow ().apiEncode (), jsonEncode ([
180+ {'operator' : 'is' , 'operand' : 'mentioned' },
181+ ]));
182+ checkNarrow (const StarredMessagesNarrow ().apiEncode (), jsonEncode ([
183+ {'operator' : 'is' , 'operand' : 'starred' },
184+ ]));
185+
179186 checkNarrow (const CombinedFeedNarrow ().apiEncode (), jsonEncode ([]));
180187 checkNarrow (const ChannelNarrow (12 ).apiEncode (), jsonEncode ([
181188 {'operator' : 'stream' , 'operand' : 12 },
@@ -184,12 +191,6 @@ void main() {
184191 {'operator' : 'stream' , 'operand' : 12 },
185192 {'operator' : 'topic' , 'operand' : 'stuff' },
186193 ]));
187- checkNarrow (const MentionsNarrow ().apiEncode (), jsonEncode ([
188- {'operator' : 'is' , 'operand' : 'mentioned' },
189- ]));
190- checkNarrow (const StarredMessagesNarrow ().apiEncode (), jsonEncode ([
191- {'operator' : 'is' , 'operand' : 'starred' },
192- ]));
193194
194195 checkNarrow ([ApiNarrowDm ([123 , 234 ])], jsonEncode ([
195196 {'operator' : 'dm' , 'operand' : [123 , 234 ]},
0 commit comments