@@ -8,10 +8,6 @@ const community = data.communities.find(
88 community => community . id === publicChannel . communityId
99) ;
1010
11- const { userId : ownerInChannelId } = data . usersChannels . find (
12- ( { channelId, isOwner } ) => channelId === publicChannel . id && isOwner
13- ) ;
14-
1511const { userId : memberInChannelId } = data . usersChannels . find (
1612 ( { channelId, isMember, isOwner } ) =>
1713 channelId === publicChannel . id && isMember && ! isOwner
@@ -33,14 +29,14 @@ const leave = () => {
3329 . last ( )
3430 . click ( ) ;
3531
36- cy . get ( '[data-cy="channel-join-button"]' ) . contains ( `Join channel ` ) ;
32+ cy . get ( '[data-cy="channel-join-button"]' ) . contains ( `Join` ) ;
3733} ;
3834
3935const join = ( ) => {
4036 cy . get ( '[data-cy="channel-join-button"]' )
4137 . last ( )
4238 . should ( 'be.visible' )
43- . contains ( 'Join channel ' ) ;
39+ . contains ( 'Join' ) ;
4440
4541 cy . get ( '[data-cy="channel-join-button"]' )
4642 . last ( )
@@ -54,8 +50,8 @@ describe('logged out channel membership', () => {
5450 cy . visit ( `/${ community . slug } /${ publicChannel . slug } ` ) ;
5551 } ) ;
5652
57- it ( 'should render join button that links to login view' , ( ) => {
58- cy . get ( '[data-cy="channel-login -join-button"]' ) . should ( 'be.visible' ) ;
53+ it ( 'should render community join button that links to login view' , ( ) => {
54+ cy . get ( '[data-cy="profile -join-button"]' ) . should ( 'be.visible' ) ;
5955 } ) ;
6056} ) ;
6157
@@ -79,23 +75,8 @@ describe('channel profile as non-member', () => {
7975 ) ;
8076 } ) ;
8177
82- it ( 'should render join channel button' , ( ) => {
83- join ( ) ;
84- leave ( ) ;
85- } ) ;
86- } ) ;
87-
88- describe ( 'channel profile as owner' , ( ) => {
89- beforeEach ( ( ) => {
90- cy . auth ( ownerInChannelId ) . then ( ( ) =>
91- cy . visit ( `/${ community . slug } /${ publicChannel . slug } ` )
92- ) ;
93- } ) ;
94-
95- it ( 'should render settings button' , ( ) => {
96- cy . get ( '[data-cy="channel-settings-button"]' )
97- . should ( 'be.visible' )
98- . contains ( 'Settings' ) ;
78+ it ( 'should render join community button' , ( ) => {
79+ cy . get ( '[data-cy="profile-join-button"]' ) . should ( 'be.visible' ) ;
9980 } ) ;
10081} ) ;
10182
0 commit comments