File tree Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ export const EVENT_MAP = {
20
20
'notification.channel_mutes_updated' : true ,
21
21
'notification.channel_truncated' : true ,
22
22
'notification.invite_accepted' : true ,
23
+ 'notification.invite_rejected' : true ,
23
24
'notification.invited' : true ,
24
25
'notification.mark_read' : true ,
25
26
'notification.message_new' : true ,
Original file line number Diff line number Diff line change @@ -905,6 +905,7 @@ export type EventTypes =
905
905
| 'notification.channel_mutes_updated'
906
906
| 'notification.channel_truncated'
907
907
| 'notification.invite_accepted'
908
+ | 'notification.invite_rejected'
908
909
| 'notification.invited'
909
910
| 'notification.mark_read'
910
911
| 'notification.message_new'
Original file line number Diff line number Diff line change @@ -167,6 +167,13 @@ describe('Member style channel init', () => {
167
167
// accept the invite, very similar to a regular update channel...
168
168
const nickChannel = nickC . channel ( 'messaging' , c . id ) ;
169
169
const thierryChannel = thierryC . channel ( 'messaging' , c . id ) ;
170
+ const inviteRejected = new Promise ( ( resolve ) => {
171
+ nickC . on ( 'notification.invite_rejected' , ( e ) => {
172
+ expect ( e . channel ) . to . be . an ( 'object' ) ;
173
+ resolve ( ) ;
174
+ } ) ;
175
+ } ) ;
176
+
170
177
const updateReceived = new Promise ( ( resolve ) => {
171
178
thierryC . on ( ( e ) => {
172
179
if ( e . type === 'member.updated' ) {
@@ -180,6 +187,7 @@ describe('Member style channel init', () => {
180
187
const response = await nickChannel . rejectInvite ( ) ;
181
188
expect ( response . members [ 1 ] . user . id ) . to . equal ( 'nick' ) ;
182
189
expect ( response . members [ 1 ] . invite_rejected_at ) . to . not . equal ( null ) ;
190
+ await inviteRejected ;
183
191
await updateReceived ;
184
192
// second time should fail...
185
193
await expectHTTPErrorCode ( 400 , nickChannel . rejectInvite ( ) ) ;
You can’t perform that action at this time.
0 commit comments