@@ -951,6 +951,34 @@ void main() {
951951 });
952952 });
953953
954+ group ('in channel/topic narrow with archived channels' , () {
955+ void checkComposeBox ({required bool isShown}) => checkComposeBoxIsShown (isShown,
956+ bannerLabel: zulipLocalizations.errorBannerCannotPostInChannelLabel);
957+
958+ final narrowTestCases = [
959+ ('channel' , const ChannelNarrow (1 )),
960+ ('topic' , eg.topicNarrow (1 , 'topic' )),
961+ ];
962+
963+ for (final (String narrowType, Narrow narrow) in narrowTestCases) {
964+ testWidgets ('error banner is shown in $narrowType narrow' , (tester) async {
965+ await prepareComposeBox (tester,
966+ narrow: narrow,
967+ selfUser: eg.user (),
968+ streams: [eg.stream (streamId: 1 , isArchived: true )]);
969+ checkComposeBox (isShown: false );
970+ });
971+
972+ testWidgets ('compose box is shown in $narrowType narrow' , (tester) async {
973+ await prepareComposeBox (tester,
974+ narrow: narrow,
975+ selfUser: eg.user (role: UserRole .administrator),
976+ streams: [eg.stream (streamId: 1 , isArchived: false )]);
977+ checkComposeBox (isShown: true );
978+ });
979+ }
980+ });
981+
954982 group ('in channel/topic narrow according to channel post policy' , () {
955983 void checkComposeBox ({required bool isShown}) => checkComposeBoxIsShown (isShown,
956984 bannerLabel: zulipLocalizations.errorBannerCannotPostInChannelLabel);
0 commit comments