@@ -63,6 +63,8 @@ void main() {
6363    List <Subscription > subscriptions =  const  [],
6464    List <Message >?  messages,
6565    bool ?  mandatoryTopics,
66+     int ?  realmVideoChatProvider,
67+     String ?  jitsiServerUrl,
6668    int ?  zulipFeatureLevel,
6769  }) async  {
6870    streams ?? =  subscriptions;
@@ -89,6 +91,8 @@ void main() {
8991      subscriptions:  subscriptions,
9092      zulipFeatureLevel:  zulipFeatureLevel,
9193      realmMandatoryTopics:  mandatoryTopics,
94+       realmVideoChatProvider:  realmVideoChatProvider,
95+       jitsiServerUrl:  jitsiServerUrl,
9296      realmAllowMessageEditing:  true ,
9397      realmMessageContentEditLimitSeconds:  null ,
9498    ));
@@ -1037,6 +1041,54 @@ void main() {
10371041    });
10381042  });
10391043
1044+   group ('video call button' , () {
1045+     Future <void > prepare (WidgetTester  tester, {
1046+       String ?  jitsiServerUrl,
1047+       int ?  realmVideoChatProvider,
1048+     }) async  {
1049+       TypingNotifier .debugEnable =  false ;
1050+       addTearDown (TypingNotifier .debugReset);
1051+ 
1052+       final  channel =  eg.stream ();
1053+       final  narrow =  ChannelNarrow (channel.streamId);
1054+       await  prepareComposeBox (tester,
1055+         narrow:  narrow,
1056+         streams:  [channel],
1057+         jitsiServerUrl :  jitsiServerUrl,
1058+         realmVideoChatProvider :  realmVideoChatProvider,
1059+       );
1060+ 
1061+       await  enterTopic (tester, narrow:  narrow, topic:  'some topic' );
1062+       await  tester.pump ();
1063+     }
1064+ 
1065+     group ('attach video call link' , () {
1066+       testWidgets ('jitsi success' , (tester) async  {
1067+         await  prepare (tester);
1068+         connection.prepare ();
1069+ 
1070+         await  tester.tap (find.byIcon (ZulipIcons .video));
1071+         await  tester.pump ();
1072+ 
1073+         check (controller! .content.text)
1074+           ..startsWith ('[Join video call.](https://meet.jit.si' )
1075+           ..endsWith ('#config.startWithVideoMuted=false)\n\n ' );
1076+       });
1077+ 
1078+       testWidgets ('zoom success' , (tester) async  {
1079+         await  prepare (tester, jitsiServerUrl:  '' ,
1080+           realmVideoChatProvider:  2 );
1081+         connection.prepare ();
1082+ 
1083+         await  tester.tap (find.byIcon (ZulipIcons .video));
1084+         await  tester.pump ();
1085+ 
1086+         check (controller! .content.text)
1087+           .equals ('[Join video call.](https://zoom.us/start/meeting)\n\n ' );
1088+       });
1089+     });
1090+   });
1091+ 
10401092  group ('uploads' , () {
10411093    void  checkAppearsLoading (WidgetTester  tester, bool  expected) {
10421094      final  sendButtonElement =  tester.element (find.ancestor (
@@ -1314,6 +1366,7 @@ void main() {
13141366      check (attachButtonFinder (ZulipIcons .attach_file).evaluate ().length).equals (areShown ?  1  :  0 );
13151367      check (attachButtonFinder (ZulipIcons .image).evaluate ().length).equals (areShown ?  1  :  0 );
13161368      check (attachButtonFinder (ZulipIcons .camera).evaluate ().length).equals (areShown ?  1  :  0 );
1369+       check (attachButtonFinder (ZulipIcons .video).evaluate ().length).equals (areShown ?  1  :  0 );
13171370    }
13181371
13191372    void  checkBannerWithLabel (String  label, {required  bool  isShown}) {
0 commit comments