@@ -874,6 +874,34 @@ void main() {
874
874
});
875
875
});
876
876
877
+ group ('in channel/topic narrow with archived channels' , () {
878
+ void checkComposeBox ({required bool isShown}) => checkComposeBoxIsShown (isShown,
879
+ bannerLabel: zulipLocalizations.errorBannerCannotPostInChannelLabel);
880
+
881
+ final narrowTestCases = [
882
+ ('channel' , const ChannelNarrow (1 )),
883
+ ('topic' , eg.topicNarrow (1 , 'topic' )),
884
+ ];
885
+
886
+ for (final (String narrowType, Narrow narrow) in narrowTestCases) {
887
+ testWidgets ('error banner is shown in $narrowType narrow' , (tester) async {
888
+ await prepareComposeBox (tester,
889
+ narrow: narrow,
890
+ selfUser: eg.user (role: UserRole .administrator),
891
+ streams: [eg.stream (streamId: 1 , isArchived: true )]);
892
+ checkComposeBox (isShown: false );
893
+ });
894
+
895
+ testWidgets ('compose box is shown in $narrowType narrow' , (tester) async {
896
+ await prepareComposeBox (tester,
897
+ narrow: narrow,
898
+ selfUser: eg.user (role: UserRole .administrator),
899
+ streams: [eg.stream (streamId: 1 , isArchived: false )]);
900
+ checkComposeBox (isShown: true );
901
+ });
902
+ }
903
+ });
904
+
877
905
group ('in channel/topic narrow according to channel post policy' , () {
878
906
void checkComposeBox ({required bool isShown}) => checkComposeBoxIsShown (isShown,
879
907
bannerLabel: zulipLocalizations.errorBannerCannotPostInChannelLabel);
0 commit comments