11import { IS_EE } from './config/constants' ;
22import { Users } from './fixtures/userStates' ;
33import { HomeChannel } from './page-objects' ;
4- import { createTargetChannel , setUserPreferences , createTargetTeam , createDirectMessage } from './utils' ;
4+ import {
5+ createArchivedChannel ,
6+ createTargetChannel ,
7+ setUserPreferences ,
8+ createTargetTeam ,
9+ createDirectMessage ,
10+ deleteChannel ,
11+ deleteTeam ,
12+ } from './utils' ;
513import { expect , test } from './utils/test' ;
614
715test . use ( { storageState : Users . user1 . state } ) ;
@@ -11,15 +19,26 @@ test.describe('video conference', () => {
1119 let poHomeChannel : HomeChannel ;
1220 let targetChannel : string ;
1321 let targetReadOnlyChannel : string ;
22+ let targetArchivedChannel : string ;
1423 let targetTeam : string ;
1524
1625 test . beforeAll ( async ( { api } ) => {
1726 targetChannel = await createTargetChannel ( api ) ;
1827 targetReadOnlyChannel = await createTargetChannel ( api , { readOnly : true } ) ;
28+ targetArchivedChannel = await createArchivedChannel ( api ) ;
1929 targetTeam = await createTargetTeam ( api ) ;
2030 await createDirectMessage ( api ) ;
2131 } ) ;
2232
33+ test . afterAll ( async ( { api } ) => {
34+ await Promise . all ( [
35+ deleteChannel ( api , targetChannel ) ,
36+ deleteChannel ( api , targetArchivedChannel ) ,
37+ deleteChannel ( api , targetReadOnlyChannel ) ,
38+ deleteTeam ( api , targetTeam ) ,
39+ ] ) ;
40+ } ) ;
41+
2342 test . beforeEach ( async ( { page } ) => {
2443 poHomeChannel = new HomeChannel ( page ) ;
2544
@@ -47,7 +66,7 @@ test.describe('video conference', () => {
4766 await expect ( poHomeChannel . content . videoConfMessageBlock . last ( ) ) . toBeVisible ( ) ;
4867 } ) ;
4968
50- test . describe ( 'test video conference message block' , async ( ) => {
69+ test . describe ( 'video conference message block' , async ( ) => {
5170 test . use ( { storageState : Users . admin . state } ) ;
5271
5372 test . beforeAll ( async ( { api } ) => {
@@ -58,22 +77,22 @@ test.describe('video conference', () => {
5877 await setUserPreferences ( api , { displayAvatars : true } ) ;
5978 } ) ;
6079
61- test ( 'should not render avatars in video conference message block' , async ( ) => {
80+ test ( 'should NOT render avatars in video conference message block' , async ( ) => {
6281 await poHomeChannel . sidenav . openChat ( targetChannel ) ;
6382
6483 await expect ( poHomeChannel . content . videoConfMessageBlock . last ( ) . getByRole ( 'figure' ) ) . toHaveCount ( 0 ) ;
6584 } ) ;
6685 } ) ;
6786
68- test . describe ( 'test received in a "target channel" ' , async ( ) => {
87+ test . describe ( 'verify if user2 received a invite call in targetChannel ' , async ( ) => {
6988 test . use ( { storageState : Users . user2 . state } ) ;
70- test ( 'verify if user received a invite call from " targetChannel" ' , async ( ) => {
89+ test ( 'should display a message block in a targetChannel' , async ( ) => {
7190 await poHomeChannel . sidenav . openChat ( targetChannel ) ;
7291 await expect ( poHomeChannel . content . videoConfMessageBlock . last ( ) ) . toBeVisible ( ) ;
7392 } ) ;
7493 } ) ;
7594
76- test ( 'expect create video conference in a direct' , async ( ) => {
95+ test ( 'should create video conference in a direct room ' , async ( ) => {
7796 await poHomeChannel . sidenav . openChat ( 'user2' ) ;
7897
7998 await poHomeChannel . content . btnVideoCall . click ( ) ;
@@ -89,23 +108,23 @@ test.describe('video conference', () => {
89108 } ) ;
90109 } ) ;
91110
92- test ( 'expect create video conference in a " targetTeam" ' , async ( ) => {
111+ test ( 'should create video conference in targetTeam' , async ( ) => {
93112 await poHomeChannel . sidenav . openChat ( targetTeam ) ;
94113
95114 await poHomeChannel . content . btnVideoCall . click ( ) ;
96115 await poHomeChannel . content . btnStartVideoCall . click ( ) ;
97116 await expect ( poHomeChannel . content . videoConfMessageBlock . last ( ) ) . toBeVisible ( ) ;
98117 } ) ;
99118
100- test . describe ( 'verify if received from a " targetTeam" ' , async ( ) => {
119+ test . describe ( 'verify if user2 received from a targetTeam' , async ( ) => {
101120 test . use ( { storageState : Users . user2 . state } ) ;
102- test ( 'verify if user received from a " targetTeam" ' , async ( ) => {
121+ test ( 'should display a message block in a targetTeam' , async ( ) => {
103122 await poHomeChannel . sidenav . openChat ( targetTeam ) ;
104123 await expect ( poHomeChannel . content . videoConfMessageBlock . last ( ) ) . toBeVisible ( ) ;
105124 } ) ;
106125 } ) ;
107126
108- test ( 'expect create video conference in a direct multiple' , async ( ) => {
127+ test ( 'should create video conference in a direct multiple' , async ( ) => {
109128 await poHomeChannel . sidenav . openChat ( 'rocketchat.internal.admin.test, user2' ) ;
110129
111130 await poHomeChannel . content . btnVideoCall . click ( ) ;
@@ -115,15 +134,21 @@ test.describe('video conference', () => {
115134
116135 test . describe ( 'received in a direct multiple' , async ( ) => {
117136 test . use ( { storageState : Users . user2 . state } ) ;
118- test ( 'verify if user received from a multiple' , async ( ) => {
137+ test ( 'should display a message block in a direct multiple' , async ( ) => {
119138 await poHomeChannel . sidenav . openChat ( 'rocketchat.internal.admin.test, user1' ) ;
120139 await expect ( poHomeChannel . content . videoConfMessageBlock . last ( ) ) . toBeVisible ( ) ;
121140 } ) ;
122141 } ) ;
123142
124- test ( 'expect create video conference not available in a " targetReadOnlyChannel" ' , async ( ) => {
143+ test ( 'should NOT create video conference in a targetReadOnlyChannel' , async ( ) => {
125144 await poHomeChannel . sidenav . openChat ( targetReadOnlyChannel ) ;
126145
127- await expect ( poHomeChannel . content . btnVideoCall ) . hasAttribute ( 'disabled' ) ;
146+ await expect ( poHomeChannel . content . btnVideoCall ) . toBeDisabled ( ) ;
147+ } ) ;
148+
149+ test ( 'should NOT be able to create video conference in targetArchivedChannel' , async ( ) => {
150+ await poHomeChannel . sidenav . openChat ( targetArchivedChannel ) ;
151+
152+ await expect ( poHomeChannel . content . btnVideoCall ) . toBeDisabled ( ) ;
128153 } ) ;
129154} ) ;
0 commit comments