@@ -60,15 +60,16 @@ void main() {
6060 .equals (store.realmUrl.resolve ('#narrow/is/starred/near/1' ));
6161 });
6262
63- test ('ChannelNarrow / TopicNarrow' , () {
63+ group ('ChannelNarrow / TopicNarrow' , () {
6464 void checkNarrow (String expectedFragment, {
6565 required int streamId,
6666 required String name,
6767 String ? topic,
6868 int ? nearMessageId,
69+ int ? zulipFeatureLevel = eg.futureZulipFeatureLevel,
6970 }) async {
7071 assert (expectedFragment.startsWith ('#' ), 'wrong-looking expectedFragment' );
71- final store = eg.store ();
72+ final store = eg.store ()..connection.zulipFeatureLevel = zulipFeatureLevel ;
7273 await store.addStream (eg.stream (streamId: streamId, name: name));
7374 final narrow = topic == null
7475 ? ChannelNarrow (streamId)
@@ -77,22 +78,32 @@ void main() {
7778 .equals (store.realmUrl.resolve (expectedFragment));
7879 }
7980
80- checkNarrow (streamId: 1 , name: 'announce' , '#narrow/stream/1-announce' );
81- checkNarrow (streamId: 378 , name: 'api design' , '#narrow/stream/378-api-design' );
82- checkNarrow (streamId: 391 , name: 'Outreachy' , '#narrow/stream/391-Outreachy' );
83- checkNarrow (streamId: 415 , name: 'chat.zulip.org' , '#narrow/stream/415-chat.2Ezulip.2Eorg' );
84- checkNarrow (streamId: 419 , name: 'français' , '#narrow/stream/419-fran.C3.A7ais' );
85- checkNarrow (streamId: 403 , name: 'Hshs[™~}(.' , '#narrow/stream/403-Hshs.5B.E2.84.A2~.7D.28.2E' );
86- checkNarrow (streamId: 60 , name: 'twitter' , nearMessageId: 1570686 , '#narrow/stream/60-twitter/near/1570686' );
87-
88- checkNarrow (streamId: 48 , name: 'mobile' , topic: 'Welcome screen UI' ,
89- '#narrow/stream/48-mobile/topic/Welcome.20screen.20UI' );
90- checkNarrow (streamId: 243 , name: 'mobile-team' , topic: 'Podfile.lock clash #F92' ,
91- '#narrow/stream/243-mobile-team/topic/Podfile.2Elock.20clash.20.23F92' );
92- checkNarrow (streamId: 377 , name: 'translation/zh_tw' , topic: '翻譯 "stream"' ,
93- '#narrow/stream/377-translation.2Fzh_tw/topic/.E7.BF.BB.E8.AD.AF.20.22stream.22' );
94- checkNarrow (streamId: 42 , name: 'Outreachy 2016-2017' , topic: '2017-18 Stream?' , nearMessageId: 302690 ,
95- '#narrow/stream/42-Outreachy-2016-2017/topic/2017-18.20Stream.3F/near/302690' );
81+ test ('modern including "channel" operator' , () {
82+ checkNarrow (streamId: 1 , name: 'announce' , '#narrow/channel/1-announce' );
83+ checkNarrow (streamId: 378 , name: 'api design' , '#narrow/channel/378-api-design' );
84+ checkNarrow (streamId: 391 , name: 'Outreachy' , '#narrow/channel/391-Outreachy' );
85+ checkNarrow (streamId: 415 , name: 'chat.zulip.org' , '#narrow/channel/415-chat.2Ezulip.2Eorg' );
86+ checkNarrow (streamId: 419 , name: 'français' , '#narrow/channel/419-fran.C3.A7ais' );
87+ checkNarrow (streamId: 403 , name: 'Hshs[™~}(.' , '#narrow/channel/403-Hshs.5B.E2.84.A2~.7D.28.2E' );
88+ checkNarrow (streamId: 60 , name: 'twitter' , nearMessageId: 1570686 , '#narrow/channel/60-twitter/near/1570686' );
89+
90+ checkNarrow (streamId: 48 , name: 'mobile' , topic: 'Welcome screen UI' ,
91+ '#narrow/channel/48-mobile/topic/Welcome.20screen.20UI' );
92+ checkNarrow (streamId: 243 , name: 'mobile-team' , topic: 'Podfile.lock clash #F92' ,
93+ '#narrow/channel/243-mobile-team/topic/Podfile.2Elock.20clash.20.23F92' );
94+ checkNarrow (streamId: 377 , name: 'translation/zh_tw' , topic: '翻譯 "stream"' ,
95+ '#narrow/channel/377-translation.2Fzh_tw/topic/.E7.BF.BB.E8.AD.AF.20.22stream.22' );
96+ checkNarrow (streamId: 42 , name: 'Outreachy 2016-2017' , topic: '2017-18 Stream?' , nearMessageId: 302690 ,
97+ '#narrow/channel/42-Outreachy-2016-2017/topic/2017-18.20Stream.3F/near/302690' );
98+ });
99+
100+ test ('legacy including "stream" operator' , () {
101+ checkNarrow (streamId: 1 , name: 'announce' , zulipFeatureLevel: 249 ,
102+ '#narrow/stream/1-announce' );
103+ checkNarrow (streamId: 48 , name: 'mobile-team' , topic: 'Welcome screen UI' ,
104+ zulipFeatureLevel: 249 ,
105+ '#narrow/stream/48-mobile/topic/Welcome.20screen.20UI' );
106+ });
96107 });
97108
98109 test ('DmNarrow' , () {
0 commit comments