@@ -110,12 +110,14 @@ void main() {
110110 required String expectedTitle,
111111 required String expectedTagComponent,
112112 }) {
113- final expectedTag = '${data .realmUri }|${data .userId }|$expectedTagComponent ' ;
113+ final expectedGroupKey = '${data .realmUri }|${data .userId }' ;
114+ final expectedTag = '$expectedGroupKey |$expectedTagComponent ' ;
114115 final expectedId =
115116 NotificationDisplayManager .notificationIdAsHashOf (expectedTag);
116117 const expectedIntentFlags =
117118 PendingIntentFlag .immutable | PendingIntentFlag .updateCurrent;
118- check (testBinding.androidNotificationHost.takeNotifyCalls ()).single
119+ final calls = testBinding.androidNotificationHost.takeNotifyCalls ();
120+ check (calls[0 ])
119121 ..id.equals (expectedId)
120122 ..tag.equals (expectedTag)
121123 ..channelId.equals (NotificationChannelManager .kChannelId)
@@ -124,11 +126,31 @@ void main() {
124126 ..color.equals (kZulipBrandColor.value)
125127 ..smallIconResourceName.equals ('zulip_notification' )
126128 ..extras.isNull ()
129+ ..groupKey.equals (expectedGroupKey)
130+ ..isGroupSummary.isNull ()
131+ ..inboxStyle.isNull ()
132+ ..autoCancel.equals (true )
127133 ..contentIntent.which ((it) => it.isNotNull ()
128134 ..requestCode.equals (expectedId)
129135 ..flags.equals (expectedIntentFlags)
130136 ..intentPayload.equals (jsonEncode (data.toJson ()))
131137 );
138+ check (calls[1 ])
139+ ..id.equals (NotificationDisplayManager .notificationIdAsHashOf (expectedGroupKey))
140+ ..tag.equals (expectedGroupKey)
141+ ..channelId.equals (NotificationChannelManager .kChannelId)
142+ ..contentTitle.isNull ()
143+ ..contentText.isNull ()
144+ ..color.equals (kZulipBrandColor.value)
145+ ..smallIconResourceName.equals ('zulip_notification' )
146+ ..extras.isNull ()
147+ ..groupKey.equals (expectedGroupKey)
148+ ..isGroupSummary.equals (true )
149+ ..inboxStyle.which ((it) => it.isNotNull ()
150+ ..summaryText.equals (data.realmUri.toString ())
151+ )
152+ ..autoCancel.equals (true )
153+ ..contentIntent.isNull ();
132154 }
133155
134156 Future <void > checkNotifications (FakeAsync async , MessageFcmMessage data, {
@@ -157,7 +179,7 @@ void main() {
157179 final stream = eg.stream ();
158180 final message = eg.streamMessage (stream: stream);
159181 await checkNotifications (async , messageFcmMessage (message, streamName: stream.name),
160- expectedTitle: '${stream .name } > ${message .subject }' ,
182+ expectedTitle: '# ${stream .name } > ${message .subject }' ,
161183 expectedTagComponent: 'stream:${message .streamId }:${message .subject }' );
162184 }));
163185
@@ -166,7 +188,7 @@ void main() {
166188 final stream = eg.stream ();
167189 final message = eg.streamMessage (stream: stream);
168190 await checkNotifications (async , messageFcmMessage (message, streamName: null ),
169- expectedTitle: '(unknown stream) > ${message .subject }' ,
191+ expectedTitle: '# (unknown stream) > ${message .subject }' ,
170192 expectedTagComponent: 'stream:${message .streamId }:${message .subject }' );
171193 }));
172194
@@ -376,10 +398,18 @@ extension on Subject<AndroidNotificationHostApiNotifyCall> {
376398 Subject <String ?> get contentTitle => has ((x) => x.contentTitle, 'contentTitle' );
377399 Subject <Map <String ?, String ?>?> get extras => has ((x) => x.extras, 'extras' );
378400 Subject <String ?> get smallIconResourceName => has ((x) => x.smallIconResourceName, 'smallIconResourceName' );
401+ Subject <String ?> get groupKey => has ((x) => x.groupKey, 'groupKey' );
402+ Subject <bool ?> get isGroupSummary => has ((x) => x.isGroupSummary, 'isGroupSummary' );
403+ Subject <InboxStyle ?> get inboxStyle => has ((x) => x.inboxStyle, 'inboxStyle' );
404+ Subject <bool ?> get autoCancel => has ((x) => x.autoCancel, 'autoCancel' );
379405}
380406
381407extension on Subject <PendingIntent > {
382408 Subject <int > get requestCode => has ((x) => x.requestCode, 'requestCode' );
383409 Subject <String > get intentPayload => has ((x) => x.intentPayload, 'intentPayload' );
384410 Subject <int > get flags => has ((x) => x.flags, 'flags' );
385411}
412+
413+ extension on Subject <InboxStyle > {
414+ Subject <String > get summaryText => has ((x) => x.summaryText, 'summaryText' );
415+ }
0 commit comments