forked from slackapi/bolt-js
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix slackapi#926 by adding more subtype ones to message event types
- Loading branch information
Showing
2 changed files
with
284 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
// tslint:disable:no-implicit-dependencies | ||
import { assert } from 'chai'; | ||
import { BotMessageEvent, MessageEvent } from './message-events'; | ||
|
||
describe('message event types', () => { | ||
it('should be compatible with bot_message payload', () => { | ||
const payload: BotMessageEvent = { | ||
type: 'message', | ||
subtype: 'bot_message', | ||
bot_id: '', | ||
username: '', | ||
icons: {}, | ||
channel: '', | ||
text: '', | ||
blocks: [], | ||
thread_ts: '', | ||
ts: '', | ||
event_ts: '', | ||
channel_type: 'channel', | ||
}; | ||
assert.isNotEmpty(payload); | ||
}); | ||
|
||
it('should be compatible with channel_archive payload', () => { | ||
const payload: MessageEvent = { | ||
type: 'message', | ||
subtype: 'channel_archive', | ||
team: '', | ||
user: '', | ||
channel: '', | ||
channel_type: 'channel', | ||
text: '', | ||
ts: '', | ||
event_ts: '', | ||
}; | ||
assert.isNotEmpty(payload); | ||
}); | ||
it('should be compatible with channel_join payload', () => { | ||
const payload: MessageEvent = { | ||
type: 'message', | ||
subtype: 'channel_join', | ||
team: '', | ||
user: '', | ||
inviter: '', | ||
channel: '', | ||
channel_type: 'channel', | ||
text: '', | ||
ts: '', | ||
event_ts: '', | ||
}; | ||
assert.isNotEmpty(payload); | ||
}); | ||
it('should be compatible with channel_leave payload', () => { | ||
const payload: MessageEvent = { | ||
type: 'message', | ||
subtype: 'channel_leave', | ||
team: '', | ||
user: '', | ||
channel: '', | ||
channel_type: 'channel', | ||
text: '', | ||
ts: '', | ||
event_ts: '', | ||
}; | ||
assert.isNotEmpty(payload); | ||
}); | ||
it('should be compatible with channel_name payload', () => { | ||
const payload: MessageEvent = { | ||
type: 'message', | ||
subtype: 'channel_name', | ||
team: '', | ||
user: '', | ||
name: '', | ||
old_name: '', | ||
channel: '', | ||
channel_type: 'channel', | ||
text: '', | ||
ts: '', | ||
event_ts: '', | ||
}; | ||
assert.isNotEmpty(payload); | ||
}); | ||
it('should be compatible with channel_posting_permissions payload', () => { | ||
const payload: MessageEvent = { | ||
type: 'message', | ||
subtype: 'channel_posting_permissions', | ||
user: '', | ||
channel: '', | ||
channel_type: 'channel', | ||
text: '', | ||
ts: '', | ||
event_ts: '', | ||
}; | ||
assert.isNotEmpty(payload); | ||
}); | ||
it('should be compatible with channel_purpose payload', () => { | ||
const payload: MessageEvent = { | ||
type: 'message', | ||
subtype: 'channel_purpose', | ||
user: '', | ||
channel: '', | ||
channel_type: 'channel', | ||
text: '', | ||
purpose: '', | ||
ts: '', | ||
event_ts: '', | ||
}; | ||
assert.isNotEmpty(payload); | ||
}); | ||
it('should be compatible with channel_topic payload', () => { | ||
const payload: MessageEvent = { | ||
type: 'message', | ||
subtype: 'channel_topic', | ||
user: '', | ||
channel: '', | ||
channel_type: 'channel', | ||
text: '', | ||
topic: '', | ||
ts: '', | ||
event_ts: '', | ||
}; | ||
assert.isNotEmpty(payload); | ||
}); | ||
it('should be compatible with channel_unarchive payload', () => { | ||
const payload: MessageEvent = { | ||
type: 'message', | ||
subtype: 'channel_unarchive', | ||
team: '', | ||
user: '', | ||
channel: '', | ||
channel_type: 'channel', | ||
text: '', | ||
ts: '', | ||
event_ts: '', | ||
}; | ||
assert.isNotEmpty(payload); | ||
}); | ||
it('should be compatible with file_share payload', () => { | ||
const payload: MessageEvent = { | ||
type: 'message', | ||
subtype: 'file_share', | ||
user: '', | ||
channel: '', | ||
channel_type: 'channel', | ||
blocks: [], | ||
attachments: [], | ||
files: [], | ||
upload: false, | ||
display_as_bot: false, | ||
parent_user_id: '', | ||
text: '', | ||
ts: '', | ||
thread_ts: '', | ||
event_ts: '', | ||
}; | ||
assert.isNotEmpty(payload); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters