@@ -9,6 +9,7 @@ import 'package:http/http.dart' as http;
9
9
import 'package:zulip/api/model/events.dart' ;
10
10
import 'package:zulip/api/model/initial_snapshot.dart' ;
11
11
import 'package:zulip/api/model/model.dart' ;
12
+ import 'package:zulip/api/model/narrow.dart' ;
12
13
import 'package:zulip/api/route/messages.dart' ;
13
14
import 'package:zulip/model/localizations.dart' ;
14
15
import 'package:zulip/model/narrow.dart' ;
@@ -589,6 +590,7 @@ void main() {
589
590
firstProcessedId: null , lastProcessedId: null ,
590
591
foundOldest: true , foundNewest: true ).toJson ());
591
592
await tester.tap (find.byType (MarkAsReadWidget ));
593
+ final apiNarrow = narrow.apiEncode ()..add (ApiNarrowIsUnread ());
592
594
check (connection.lastRequest).isA< http.Request > ()
593
595
..method.equals ('POST' )
594
596
..url.path.equals ('/api/v1/messages/flags/narrow' )
@@ -597,7 +599,7 @@ void main() {
597
599
'include_anchor' : 'false' ,
598
600
'num_before' : '0' ,
599
601
'num_after' : '1000' ,
600
- 'narrow' : jsonEncode (narrow. apiEncode () ),
602
+ 'narrow' : jsonEncode (apiNarrow ),
601
603
'op' : 'add' ,
602
604
'flag' : 'read' ,
603
605
});
@@ -647,6 +649,7 @@ void main() {
647
649
firstProcessedId: 1 , lastProcessedId: 1989 ,
648
650
foundOldest: true , foundNewest: false ).toJson ());
649
651
await tester.tap (find.byType (MarkAsReadWidget ));
652
+ final apiNarrow = narrow.apiEncode ()..add (ApiNarrowIsUnread ());
650
653
check (connection.lastRequest).isA< http.Request > ()
651
654
..method.equals ('POST' )
652
655
..url.path.equals ('/api/v1/messages/flags/narrow' )
@@ -655,7 +658,7 @@ void main() {
655
658
'include_anchor' : 'false' ,
656
659
'num_before' : '0' ,
657
660
'num_after' : '1000' ,
658
- 'narrow' : jsonEncode (narrow. apiEncode () ),
661
+ 'narrow' : jsonEncode (apiNarrow ),
659
662
'op' : 'add' ,
660
663
'flag' : 'read' ,
661
664
});
@@ -674,7 +677,7 @@ void main() {
674
677
'include_anchor' : 'false' ,
675
678
'num_before' : '0' ,
676
679
'num_after' : '1000' ,
677
- 'narrow' : jsonEncode (narrow. apiEncode () ),
680
+ 'narrow' : jsonEncode (apiNarrow ),
678
681
'op' : 'add' ,
679
682
'flag' : 'read' ,
680
683
});
@@ -693,6 +696,7 @@ void main() {
693
696
firstProcessedId: null , lastProcessedId: null ,
694
697
foundOldest: true , foundNewest: false ).toJson ());
695
698
await tester.tap (find.byType (MarkAsReadWidget ));
699
+ final apiNarrow = narrow.apiEncode ()..add (ApiNarrowIsUnread ());
696
700
check (connection.lastRequest).isA< http.Request > ()
697
701
..method.equals ('POST' )
698
702
..url.path.equals ('/api/v1/messages/flags/narrow' )
@@ -701,7 +705,7 @@ void main() {
701
705
'include_anchor' : 'false' ,
702
706
'num_before' : '0' ,
703
707
'num_after' : '1000' ,
704
- 'narrow' : jsonEncode (narrow. apiEncode () ),
708
+ 'narrow' : jsonEncode (apiNarrow ),
705
709
'op' : 'add' ,
706
710
'flag' : 'read' ,
707
711
});
0 commit comments