@@ -109,6 +109,20 @@ describe('Message utils', () => {
109109 ) ;
110110 } ) ;
111111
112+ it ( 'should return message actions specified in custom actions array depending on channel config if actions are set to true' , ( ) => {
113+ const result = getMessageActions ( [ 'remindMe' ] , defaultCapabilities , {
114+ user_message_reminders : true ,
115+ } ) ;
116+ expect ( result ) . toStrictEqual ( [ 'remindMe' ] ) ;
117+ } ) ;
118+
119+ it ( 'should return message actions specified in custom actions array depending on channel config if actions are set to true' , ( ) => {
120+ const result = getMessageActions ( [ 'saveForLater' ] , defaultCapabilities , {
121+ user_message_reminders : true ,
122+ } ) ;
123+ expect ( result ) . toStrictEqual ( [ 'saveForLater' ] ) ;
124+ } ) ;
125+
112126 it ( 'should include reminder actions if enabled in channel config' , ( ) => {
113127 const result = getMessageActions ( true , defaultCapabilities , {
114128 user_message_reminders : true ,
@@ -137,9 +151,9 @@ describe('Message utils', () => {
137151 } ;
138152 const result = getMessageActions ( actions , capabilities ) ;
139153 if ( capabilityValue ) {
140- expect ( result ) . toContain ( action ) ;
154+ expect ( result ) . toStrictEqual ( [ action ] ) ;
141155 } else {
142- expect ( result ) . not . toContain ( action ) ;
156+ expect ( result ) . not . toStrictEqual ( [ action ] ) ;
143157 }
144158 } ) ;
145159 } ) ;
0 commit comments