@@ -58,11 +58,14 @@ void main() {
58
58
required Narrow narrow,
59
59
User ? selfUser,
60
60
List <User > otherUsers = const [],
61
- List <ZulipStream > streams = const [],
61
+ List <ZulipStream >? streams,
62
+ List <Subscription > subscriptions = const [],
62
63
List <Message >? messages,
63
64
bool ? mandatoryTopics,
64
65
int ? zulipFeatureLevel,
65
66
}) async {
67
+ streams ?? = subscriptions;
68
+
66
69
if (narrow case ChannelNarrow (: var streamId) || TopicNarrow (: var streamId)) {
67
70
final channel = streams.firstWhereOrNull ((s) => s.streamId == streamId);
68
71
assert (channel != null ,
@@ -82,6 +85,7 @@ void main() {
82
85
await testBinding.globalStore.add (selfAccount, eg.initialSnapshot (
83
86
realmUsers: [selfUser, ...otherUsers],
84
87
streams: streams,
88
+ subscriptions: subscriptions,
85
89
zulipFeatureLevel: zulipFeatureLevel,
86
90
realmMandatoryTopics: mandatoryTopics,
87
91
realmAllowMessageEditing: true ,
@@ -1417,17 +1421,17 @@ void main() {
1417
1421
await prepareComposeBox (tester,
1418
1422
narrow: narrow,
1419
1423
selfUser: eg.user (role: UserRole .administrator),
1420
- streams : [eg.stream (streamId: 1 ,
1421
- channelPostPolicy: ChannelPostPolicy .moderators)]);
1424
+ subscriptions : [eg. subscription ( eg.stream (streamId: 1 ,
1425
+ channelPostPolicy: ChannelPostPolicy .moderators)) ]);
1422
1426
checkComposeBox (isShown: true );
1423
1427
});
1424
1428
1425
1429
testWidgets ('error banner is shown in $narrowType narrow' , (tester) async {
1426
1430
await prepareComposeBox (tester,
1427
1431
narrow: narrow,
1428
1432
selfUser: eg.user (role: UserRole .moderator),
1429
- streams : [eg.stream (streamId: 1 ,
1430
- channelPostPolicy: ChannelPostPolicy .administrators)]);
1433
+ subscriptions : [eg. subscription ( eg.stream (streamId: 1 ,
1434
+ channelPostPolicy: ChannelPostPolicy .administrators)) ]);
1431
1435
checkComposeBox (isShown: false );
1432
1436
});
1433
1437
}
@@ -1437,8 +1441,8 @@ void main() {
1437
1441
await prepareComposeBox (tester,
1438
1442
narrow: const ChannelNarrow (1 ),
1439
1443
selfUser: selfUser,
1440
- streams : [eg.stream (streamId: 1 ,
1441
- channelPostPolicy: ChannelPostPolicy .administrators)]);
1444
+ subscriptions : [eg. subscription ( eg.stream (streamId: 1 ,
1445
+ channelPostPolicy: ChannelPostPolicy .administrators)) ]);
1442
1446
checkComposeBox (isShown: true );
1443
1447
1444
1448
await store.handleEvent (RealmUserUpdateEvent (id: 1 ,
@@ -1452,8 +1456,8 @@ void main() {
1452
1456
await prepareComposeBox (tester,
1453
1457
narrow: const ChannelNarrow (1 ),
1454
1458
selfUser: selfUser,
1455
- streams : [eg.stream (streamId: 1 ,
1456
- channelPostPolicy: ChannelPostPolicy .moderators)]);
1459
+ subscriptions : [eg. subscription ( eg.stream (streamId: 1 ,
1460
+ channelPostPolicy: ChannelPostPolicy .moderators)) ]);
1457
1461
checkComposeBox (isShown: false );
1458
1462
1459
1463
await store.handleEvent (RealmUserUpdateEvent (id: 1 ,
@@ -1470,7 +1474,7 @@ void main() {
1470
1474
await prepareComposeBox (tester,
1471
1475
narrow: const ChannelNarrow (1 ),
1472
1476
selfUser: selfUser,
1473
- streams : [channel]);
1477
+ subscriptions : [eg. subscription ( channel) ]);
1474
1478
checkComposeBox (isShown: true );
1475
1479
1476
1480
await store.handleEvent (eg.channelUpdateEvent (channel,
@@ -1488,7 +1492,7 @@ void main() {
1488
1492
await prepareComposeBox (tester,
1489
1493
narrow: const ChannelNarrow (1 ),
1490
1494
selfUser: selfUser,
1491
- streams : [channel]);
1495
+ subscriptions : [eg. subscription ( channel) ]);
1492
1496
checkComposeBox (isShown: false );
1493
1497
1494
1498
await store.handleEvent (eg.channelUpdateEvent (channel,
0 commit comments