@@ -177,19 +177,21 @@ void main() {
177
177
}) async {
178
178
final effectiveChannel = channel ?? someChannel;
179
179
final effectiveMessages = messages ?? [someMessage];
180
- assert (effectiveMessages.every ((m) => m.topic.apiName == topic));
180
+ final topicName = TopicName (topic);
181
+ assert (effectiveMessages.every ((m) => m.topic.apiName == topicName.apiName));
181
182
182
183
connection.prepare (json: eg.newestGetMessagesResult (
183
184
foundOldest: true , messages: effectiveMessages).toJson ());
184
185
await tester.pumpWidget (TestZulipApp (accountId: eg.selfAccount.id,
185
186
child: MessageListPage (
186
- initNarrow: eg.topicNarrow (effectiveChannel.streamId, topic ))));
187
+ initNarrow: eg.topicNarrow (effectiveChannel.streamId, topicName.apiName ))));
187
188
// global store, per-account store, and message list get loaded
188
189
await tester.pumpAndSettle ();
189
190
190
191
final topicRow = find.descendant (
191
192
of: find.byType (ZulipAppBar ),
192
- matching: find.text (topic));
193
+ // ignore: dead_null_aware_expression // null topic names soon to be enabled
194
+ matching: find.text (topicName.displayName ?? eg.defaultRealmEmptyTopicDisplayName));
193
195
await tester.longPress (topicRow);
194
196
// sheet appears onscreen; default duration of bottom-sheet enter animation
195
197
await tester.pump (const Duration (milliseconds: 250 ));
@@ -265,6 +267,16 @@ void main() {
265
267
check (findButtonForLabel ('Mark as unresolved' )).findsNothing ();
266
268
});
267
269
270
+ testWidgets ('show from app bar: resolve/unresolve not offered when topic is empty' , (tester) async {
271
+ await prepare ();
272
+ final message = eg.streamMessage (stream: someChannel, topic: '' );
273
+ await showFromAppBar (tester,
274
+ topic: '' ,
275
+ messages: [message]);
276
+ check (findButtonForLabel ('Mark as resolved' )).findsNothing ();
277
+ check (findButtonForLabel ('Mark as unresolved' )).findsNothing ();
278
+ }, skip: true ); // null topic names soon to be enabled
279
+
268
280
testWidgets ('show from recipient header' , (tester) async {
269
281
await prepare ();
270
282
await showFromRecipientHeader (tester);
0 commit comments