Skip to content

Commit 90770e1

Browse files
committed
compose: Unskip test; handle TopicName with empty displayName for now
This logic was introduced in 769cc7d, which relied on the fact that TopicName.displayName is `null` when the topic is empty. Normally it is fine to assume that the displayName is non-empty with the server flags, but in this case the TopicName is constructed by our code.
1 parent 5ec097c commit 90770e1

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/widgets/compose_box.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,8 +655,10 @@ class _StreamContentInputState extends State<_StreamContentInput> {
655655
// so don't make sense to translate. See:
656656
// https://github.com/zulip/zulip-flutter/pull/1148#discussion_r1941990585
657657
? '#$streamName'
658-
// ignore: dead_null_aware_expression // null topic names soon to be enabled
659-
: '#$streamName > ${hintTopic.displayName ?? store.realmEmptyTopicDisplayName}';
658+
// null topic names soon to be enabled
659+
: '#$streamName > '
660+
'${hintTopic.displayName.isEmpty ? store.realmEmptyTopicDisplayName
661+
: hintTopic.displayName}';
660662

661663
return _TypingNotifier(
662664
destination: TopicNarrow(widget.narrow.streamId,

test/widgets/compose_box_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ void main() {
398398
topicHintText: 'Topic',
399399
contentHintText: 'Message #${channel.name} > '
400400
'${eg.defaultRealmEmptyTopicDisplayName}');
401-
}, skip: true); // null topic names soon to be enabled
401+
});
402402

403403
testWidgets('legacy: with empty topic, content input has focus', (tester) async {
404404
await prepare(tester, narrow: narrow, mandatoryTopics: false,

0 commit comments

Comments
 (0)