Skip to content

Commit f3b2c4a

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 8cf9c37 commit f3b2c4a

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
@@ -642,8 +642,10 @@ class _StreamContentInputState extends State<_StreamContentInput> {
642642
// so don't make sense to translate. See:
643643
// https://github.com/zulip/zulip-flutter/pull/1148#discussion_r1941990585
644644
? '#$streamName'
645-
// ignore: dead_null_aware_expression // null topic names soon to be enabled
646-
: '#$streamName > ${hintTopic.displayName ?? store.realmEmptyTopicDisplayName}';
645+
// null topic names soon to be enabled
646+
: '#$streamName > '
647+
'${hintTopic.displayName.isEmpty ? store.realmEmptyTopicDisplayName
648+
: hintTopic.displayName}';
647649

648650
return _ContentInput(
649651
narrow: widget.narrow,

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)