@@ -109,6 +109,20 @@ describe('Message utils', () => {
109
109
) ;
110
110
} ) ;
111
111
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
+
112
126
it ( 'should include reminder actions if enabled in channel config' , ( ) => {
113
127
const result = getMessageActions ( true , defaultCapabilities , {
114
128
user_message_reminders : true ,
@@ -137,9 +151,9 @@ describe('Message utils', () => {
137
151
} ;
138
152
const result = getMessageActions ( actions , capabilities ) ;
139
153
if ( capabilityValue ) {
140
- expect ( result ) . toContain ( action ) ;
154
+ expect ( result ) . toStrictEqual ( [ action ] ) ;
141
155
} else {
142
- expect ( result ) . not . toContain ( action ) ;
156
+ expect ( result ) . not . toStrictEqual ( [ action ] ) ;
143
157
}
144
158
} ) ;
145
159
} ) ;
0 commit comments