@@ -90,31 +90,19 @@ describe('useChannelActionItems', () => {
9090 it ( 'returns default channel action items' , ( ) => {
9191 const { result } = renderHook ( ( ) => useChannelActionItems ( { channel } ) ) ;
9292
93- expect ( result . current ) . toHaveLength ( 4 ) ;
93+ expect ( result . current ) . toHaveLength ( 3 ) ;
9494 expect ( result . current . map ( ( item ) => item . action ) ) . toEqual ( [
9595 channelActions . muteChannel ,
96- channelActions . archive ,
9796 channelActions . leave ,
9897 expect . any ( Function ) ,
9998 ] ) ;
100- expect ( result . current . map ( ( item ) => item . id ) ) . toEqual ( [
101- 'mute' ,
102- 'archive' ,
103- 'leave' ,
104- 'deleteChannel' ,
105- ] ) ;
99+ expect ( result . current . map ( ( item ) => item . id ) ) . toEqual ( [ 'mute' , 'leave' , 'deleteChannel' ] ) ;
106100 expect ( result . current . map ( ( item ) => item . type ) ) . toEqual ( [
107- 'standard' ,
108101 'standard' ,
109102 'destructive' ,
110103 'destructive' ,
111104 ] ) ;
112- expect ( result . current . map ( ( item ) => item . placement ) ) . toEqual ( [
113- 'swipe' ,
114- 'both' ,
115- 'sheet' ,
116- 'sheet' ,
117- ] ) ;
105+ expect ( result . current . map ( ( item ) => item . placement ) ) . toEqual ( [ 'swipe' , 'sheet' , 'sheet' ] ) ;
118106 } ) ;
119107
120108 it ( 'uses custom getChannelActionItems with context and defaultItems when provided' , ( ) => {
@@ -178,25 +166,18 @@ describe('getChannelActionItems', () => {
178166
179167 expect ( actionItems . map ( ( item ) => item . action ) ) . toEqual ( [
180168 channelActions . muteChannel ,
181- channelActions . archive ,
182169 channelActions . leave ,
183170 expect . any ( Function ) ,
184171 ] ) ;
185- expect ( actionItems . map ( ( item ) => item . id ) ) . toEqual ( [
186- 'mute' ,
187- 'archive' ,
188- 'leave' ,
189- 'deleteChannel' ,
190- ] ) ;
172+ expect ( actionItems . map ( ( item ) => item . id ) ) . toEqual ( [ 'mute' , 'leave' , 'deleteChannel' ] ) ;
191173 expect ( actionItems . map ( ( item ) => item . type ) ) . toEqual ( [
192- 'standard' ,
193174 'standard' ,
194175 'destructive' ,
195176 'destructive' ,
196177 ] ) ;
197178 } ) ;
198179
199- it ( 'returns direct-chat variants for mute, block and archive states' , ( ) => {
180+ it ( 'returns direct-chat variants for mute and block states' , ( ) => {
200181 const channelActions = createChannelActions ( ) ;
201182 const actionItems = buildDefaultChannelActionItems ( {
202183 actions : channelActions ,
@@ -208,34 +189,20 @@ describe('getChannelActionItems', () => {
208189 t : ( value ) => value ,
209190 } ) ;
210191
211- expect ( actionItems . map ( ( item ) => item . id ) ) . toEqual ( [
212- 'mute' ,
213- 'block' ,
214- 'archive' ,
215- 'leave' ,
216- 'deleteChannel' ,
217- ] ) ;
192+ expect ( actionItems . map ( ( item ) => item . id ) ) . toEqual ( [ 'mute' , 'block' , 'leave' , 'deleteChannel' ] ) ;
218193 expect ( actionItems . map ( ( item ) => item . action ) ) . toEqual ( [
219194 channelActions . unmuteUser ,
220195 channelActions . unblockUser ,
221- channelActions . unarchive ,
222196 channelActions . leave ,
223197 expect . any ( Function ) ,
224198 ] ) ;
225199 expect ( actionItems . map ( ( item ) => item . label ) ) . toEqual ( [
226200 'Unmute User' ,
227201 'Unblock User' ,
228- 'Unarchive Chat' ,
229202 'Leave Chat' ,
230203 'Delete Chat' ,
231204 ] ) ;
232- expect ( actionItems . map ( ( item ) => item . placement ) ) . toEqual ( [
233- 'sheet' ,
234- 'sheet' ,
235- 'sheet' ,
236- 'sheet' ,
237- 'sheet' ,
238- ] ) ;
205+ expect ( actionItems . map ( ( item ) => item . placement ) ) . toEqual ( [ 'sheet' , 'sheet' , 'sheet' , 'sheet' ] ) ;
239206 } ) ;
240207
241208 it ( 'omits delete action when current user is not the channel creator' , ( ) => {
@@ -249,10 +216,10 @@ describe('getChannelActionItems', () => {
249216 t : ( value ) => value ,
250217 } ) ;
251218
252- expect ( actionItems . map ( ( item ) => item . id ) ) . toEqual ( [ 'mute' , 'archive' , ' leave'] ) ;
219+ expect ( actionItems . map ( ( item ) => item . id ) ) . toEqual ( [ 'mute' , 'leave' ] ) ;
253220 } ) ;
254221
255- it ( 'uses group variants for mute and archive labels and placements' , ( ) => {
222+ it ( 'uses group mute variants for labels and placements' , ( ) => {
256223 const channelActions = createChannelActions ( ) ;
257224 const actionItems = buildDefaultChannelActionItems ( {
258225 actions : channelActions ,
@@ -268,9 +235,9 @@ describe('getChannelActionItems', () => {
268235 expect ( actionItems [ 0 ] . label ) . toBe ( 'Unmute Group' ) ;
269236 expect ( actionItems [ 0 ] . placement ) . toBe ( 'swipe' ) ;
270237
271- expect ( actionItems [ 1 ] . action ) . toBe ( channelActions . unarchive ) ;
272- expect ( actionItems [ 1 ] . label ) . toBe ( 'Unarchive Group' ) ;
273- expect ( actionItems [ 1 ] . placement ) . toBe ( 'both ' ) ;
238+ expect ( actionItems [ 1 ] . action ) . toBe ( channelActions . leave ) ;
239+ expect ( actionItems [ 1 ] . label ) . toBe ( 'Leave Group' ) ;
240+ expect ( actionItems [ 1 ] . placement ) . toBe ( 'sheet ' ) ;
274241 } ) ;
275242
276243 it ( 'shows delete confirmation and calls deleteChannel on destructive confirm' , async ( ) => {
0 commit comments