File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
src/components/Message/__tests__ Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -513,6 +513,19 @@ describe('<Message /> component', () => {
513513 expect ( getMessageActions ( ) ) . toContain ( MESSAGE_ACTIONS . delete ) ;
514514 } ) ;
515515
516+ it ( 'should allow user to edit and delete message when moderator role is set on client' , async ( ) => {
517+ const amin = generateUser ( {
518+ name : 'amin' ,
519+ role : 'channel_moderator' ,
520+ } ) ;
521+ const client = await getTestClientWithUser ( amin ) ;
522+ const message = generateMessage ( { user : bob } ) ;
523+ await renderComponent ( message , { } , { client } ) ;
524+ const { getMessageActions } = getRenderedProps ( ) ;
525+ expect ( getMessageActions ( ) ) . toContain ( MESSAGE_ACTIONS . edit ) ;
526+ expect ( getMessageActions ( ) ) . toContain ( MESSAGE_ACTIONS . delete ) ;
527+ } ) ;
528+
516529 it ( 'should allow user to edit and delete message when user is admin' , async ( ) => {
517530 const message = generateMessage ( { user : bob } ) ;
518531 await renderComponent (
You can’t perform that action at this time.
0 commit comments