@@ -169,13 +169,20 @@ void main() {
169
169
});
170
170
});
171
171
172
- test ('Narrow .toJson' , () {
172
+ test ('ApiNarrow .toJson' , () {
173
173
return FakeApiConnection .with_ ((connection) async {
174
174
void checkNarrow (ApiNarrow narrow, String expected) {
175
175
narrow = resolveApiNarrowForServer (narrow, connection.zulipFeatureLevel! );
176
176
check (jsonEncode (narrow)).equals (expected);
177
177
}
178
178
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
+
179
186
checkNarrow (const CombinedFeedNarrow ().apiEncode (), jsonEncode ([]));
180
187
checkNarrow (const ChannelNarrow (12 ).apiEncode (), jsonEncode ([
181
188
{'operator' : 'stream' , 'operand' : 12 },
@@ -184,12 +191,6 @@ void main() {
184
191
{'operator' : 'stream' , 'operand' : 12 },
185
192
{'operator' : 'topic' , 'operand' : 'stuff' },
186
193
]));
187
- checkNarrow (const MentionsNarrow ().apiEncode (), jsonEncode ([
188
- {'operator' : 'is' , 'operand' : 'mentioned' },
189
- ]));
190
- checkNarrow (const StarredMessagesNarrow ().apiEncode (), jsonEncode ([
191
- {'operator' : 'is' , 'operand' : 'starred' },
192
- ]));
193
194
194
195
checkNarrow ([ApiNarrowDm ([123 , 234 ])], jsonEncode ([
195
196
{'operator' : 'dm' , 'operand' : [123 , 234 ]},
0 commit comments