@@ -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' ;
@@ -479,6 +480,7 @@ void main() {
479
480
firstProcessedId: null , lastProcessedId: null ,
480
481
foundOldest: true , foundNewest: true ).toJson ());
481
482
await tester.tap (find.byType (MarkAsReadWidget ));
483
+ final apiNarrow = narrow.apiEncode ()..add (ApiNarrowIsUnread ());
482
484
check (connection.lastRequest).isA< http.Request > ()
483
485
..method.equals ('POST' )
484
486
..url.path.equals ('/api/v1/messages/flags/narrow' )
@@ -487,7 +489,7 @@ void main() {
487
489
'include_anchor' : 'false' ,
488
490
'num_before' : '0' ,
489
491
'num_after' : '1000' ,
490
- 'narrow' : jsonEncode (narrow. apiEncode () ),
492
+ 'narrow' : jsonEncode (apiNarrow ),
491
493
'op' : 'add' ,
492
494
'flag' : 'read' ,
493
495
});
@@ -537,6 +539,7 @@ void main() {
537
539
firstProcessedId: 1 , lastProcessedId: 1989 ,
538
540
foundOldest: true , foundNewest: false ).toJson ());
539
541
await tester.tap (find.byType (MarkAsReadWidget ));
542
+ final apiNarrow = narrow.apiEncode ()..add (ApiNarrowIsUnread ());
540
543
check (connection.lastRequest).isA< http.Request > ()
541
544
..method.equals ('POST' )
542
545
..url.path.equals ('/api/v1/messages/flags/narrow' )
@@ -545,7 +548,7 @@ void main() {
545
548
'include_anchor' : 'false' ,
546
549
'num_before' : '0' ,
547
550
'num_after' : '1000' ,
548
- 'narrow' : jsonEncode (narrow. apiEncode () ),
551
+ 'narrow' : jsonEncode (apiNarrow ),
549
552
'op' : 'add' ,
550
553
'flag' : 'read' ,
551
554
});
@@ -564,7 +567,7 @@ void main() {
564
567
'include_anchor' : 'false' ,
565
568
'num_before' : '0' ,
566
569
'num_after' : '1000' ,
567
- 'narrow' : jsonEncode (narrow. apiEncode () ),
570
+ 'narrow' : jsonEncode (apiNarrow ),
568
571
'op' : 'add' ,
569
572
'flag' : 'read' ,
570
573
});
@@ -583,6 +586,7 @@ void main() {
583
586
firstProcessedId: null , lastProcessedId: null ,
584
587
foundOldest: true , foundNewest: false ).toJson ());
585
588
await tester.tap (find.byType (MarkAsReadWidget ));
589
+ final apiNarrow = narrow.apiEncode ()..add (ApiNarrowIsUnread ());
586
590
check (connection.lastRequest).isA< http.Request > ()
587
591
..method.equals ('POST' )
588
592
..url.path.equals ('/api/v1/messages/flags/narrow' )
@@ -591,7 +595,7 @@ void main() {
591
595
'include_anchor' : 'false' ,
592
596
'num_before' : '0' ,
593
597
'num_after' : '1000' ,
594
- 'narrow' : jsonEncode (narrow. apiEncode () ),
598
+ 'narrow' : jsonEncode (apiNarrow ),
595
599
'op' : 'add' ,
596
600
'flag' : 'read' ,
597
601
});
0 commit comments