@@ -951,6 +951,34 @@ void main() {
951
951
});
952
952
});
953
953
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
+
954
982
group ('in channel/topic narrow according to channel post policy' , () {
955
983
void checkComposeBox ({required bool isShown}) => checkComposeBoxIsShown (isShown,
956
984
bannerLabel: zulipLocalizations.errorBannerCannotPostInChannelLabel);
0 commit comments