@@ -111,24 +111,47 @@ void main() {
111
111
required String expectedTagComponent,
112
112
}) {
113
113
final expectedTag = '${data .realmUri }|${data .userId }|$expectedTagComponent ' ;
114
+ final expectedGroupKey = '${data .realmUri }|${data .userId }' ;
114
115
final expectedId =
115
116
NotificationDisplayManager .notificationIdAsHashOf (expectedTag);
116
117
const expectedIntentFlags =
117
118
PendingIntentFlag .immutable | PendingIntentFlag .updateCurrent;
118
- check (testBinding.androidNotificationHost.takeNotifyCalls ()).single
119
- ..id.equals (expectedId)
120
- ..tag.equals (expectedTag)
121
- ..channelId.equals (NotificationChannelManager .kChannelId)
122
- ..contentTitle.equals (expectedTitle)
123
- ..contentText.equals (data.content)
124
- ..color.equals (kZulipBrandColor.value)
125
- ..smallIconResourceName.equals ('zulip_notification' )
126
- ..extras.isNull ()
127
- ..contentIntent.which ((it) => it.isNotNull ()
128
- ..requestCode.equals (expectedId)
129
- ..flags.equals (expectedIntentFlags)
130
- ..intentPayload.equals (jsonEncode (data.toJson ()))
131
- );
119
+
120
+ check (testBinding.androidNotificationHost.takeNotifyCalls ())
121
+ .deepEquals (< Condition <Object ?>> [
122
+ (it) => it.isA <AndroidNotificationHostApiNotifyCall >()
123
+ ..id.equals (expectedId)
124
+ ..tag.equals (expectedTag)
125
+ ..channelId.equals (NotificationChannelManager .kChannelId)
126
+ ..contentTitle.equals (expectedTitle)
127
+ ..contentText.equals (data.content)
128
+ ..color.equals (kZulipBrandColor.value)
129
+ ..smallIconResourceName.equals ('zulip_notification' )
130
+ ..extras.isNull ()
131
+ ..groupKey.equals (expectedGroupKey)
132
+ ..isGroupSummary.isNull ()
133
+ ..inboxStyle.isNull ()
134
+ ..autoCancel.isNull ()
135
+ ..contentIntent.which ((it) => it.isNotNull ()
136
+ ..requestCode.equals (expectedId)
137
+ ..flags.equals (expectedIntentFlags)
138
+ ..intentPayload.equals (jsonEncode (data.toJson ()))),
139
+ (it) => it.isA <AndroidNotificationHostApiNotifyCall >()
140
+ ..id.equals (NotificationDisplayManager .notificationIdAsHashOf (expectedGroupKey))
141
+ ..tag.equals (expectedGroupKey)
142
+ ..channelId.equals (NotificationChannelManager .kChannelId)
143
+ ..contentTitle.isNull ()
144
+ ..contentText.isNull ()
145
+ ..color.equals (kZulipBrandColor.value)
146
+ ..smallIconResourceName.equals ('zulip_notification' )
147
+ ..extras.isNull ()
148
+ ..groupKey.equals (expectedGroupKey)
149
+ ..isGroupSummary.equals (true )
150
+ ..inboxStyle.which ((it) => it.isNotNull ()
151
+ ..summaryText.equals (data.realmUri.toString ()))
152
+ ..autoCancel.isNull ()
153
+ ..contentIntent.isNull ()
154
+ ]);
132
155
}
133
156
134
157
Future <void > checkNotifications (FakeAsync async , MessageFcmMessage data, {
@@ -369,12 +392,16 @@ extension AndroidNotificationChannelChecks on Subject<AndroidNotificationChannel
369
392
extension on Subject <AndroidNotificationHostApiNotifyCall > {
370
393
Subject <String ?> get tag => has ((x) => x.tag, 'tag' );
371
394
Subject <int > get id => has ((x) => x.id, 'id' );
395
+ Subject <bool ?> get autoCancel => has ((x) => x.autoCancel, 'autoCancel' );
372
396
Subject <String > get channelId => has ((x) => x.channelId, 'channelId' );
373
397
Subject <int ?> get color => has ((x) => x.color, 'color' );
374
398
Subject <PendingIntent ?> get contentIntent => has ((x) => x.contentIntent, 'contentIntent' );
375
399
Subject <String ?> get contentText => has ((x) => x.contentText, 'contentText' );
376
400
Subject <String ?> get contentTitle => has ((x) => x.contentTitle, 'contentTitle' );
377
401
Subject <Map <String ?, String ?>?> get extras => has ((x) => x.extras, 'extras' );
402
+ Subject <String ?> get groupKey => has ((x) => x.groupKey, 'groupKey' );
403
+ Subject <InboxStyle ?> get inboxStyle => has ((x) => x.inboxStyle, 'inboxStyle' );
404
+ Subject <bool ?> get isGroupSummary => has ((x) => x.isGroupSummary, 'isGroupSummary' );
378
405
Subject <String ?> get smallIconResourceName => has ((x) => x.smallIconResourceName, 'smallIconResourceName' );
379
406
}
380
407
@@ -383,3 +410,7 @@ extension on Subject<PendingIntent> {
383
410
Subject <String > get intentPayload => has ((x) => x.intentPayload, 'intentPayload' );
384
411
Subject <int > get flags => has ((x) => x.flags, 'flags' );
385
412
}
413
+
414
+ extension on Subject <InboxStyle > {
415
+ Subject <String > get summaryText => has ((x) => x.summaryText, 'summaryText' );
416
+ }
0 commit comments