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