@@ -2360,6 +2360,30 @@ void main() {
23602360 // testCancel(narrow: topicNarrow, start: _EditInteractionStart.restoreFailedEdit);
23612361 // testCancel(narrow: dmNarrow, start: _EditInteractionStart.restoreFailedEdit);
23622362 });
2363+
2364+ group ('compose box inputs visibility by topic policy' , () {
2365+ void testComposeBoxWidgetVisibility ({required TopicsPolicy topicsPolicy, required bool shouldShowTopicInput}) {
2366+ final description = shouldShowTopicInput ?
2367+ 'show topic input when topic policy is $topicsPolicy ' :
2368+ 'hide topic input when topic policy is $topicsPolicy ' ;
2369+
2370+ testWidgets (description, (tester) async {
2371+ final channel = eg.stream (topicsPolicy: topicsPolicy);
2372+
2373+ await prepareComposeBox (tester, narrow: ChannelNarrow (channel.streamId), streams: [channel]);
2374+
2375+ check (contentInputFinder).findsOne ();
2376+ shouldShowTopicInput ?
2377+ check (topicInputFinder).findsOne ():
2378+ check (topicInputFinder).findsNothing ();
2379+ });
2380+ }
2381+
2382+ testComposeBoxWidgetVisibility (topicsPolicy: TopicsPolicy .inherit, shouldShowTopicInput: true );
2383+ testComposeBoxWidgetVisibility (topicsPolicy: TopicsPolicy .allowEmptyTopic, shouldShowTopicInput: true );
2384+ testComposeBoxWidgetVisibility (topicsPolicy: TopicsPolicy .disableEmptyTopic, shouldShowTopicInput: true );
2385+ testComposeBoxWidgetVisibility (topicsPolicy: TopicsPolicy .emptyTopicOnly, shouldShowTopicInput: false );
2386+ });
23632387}
23642388
23652389/// How the edit interaction is started:
0 commit comments