-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: make slack support channel configurable (#20)
Co-authored-by: Grégoire Paris <[email protected]>
- Loading branch information
Showing
7 changed files
with
58 additions
and
9 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
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
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,30 @@ | ||
import { HTTP_STATUS_OK } from '@/constants'; | ||
import { fetch } from '../utils/fetch'; | ||
import { getSlackHeaders } from '../utils/getSlackHeaders'; | ||
|
||
describe('help', () => { | ||
it('help message should be displayed', async () => { | ||
// Given | ||
const channelId = 'channelId'; | ||
const userId = 'userId'; | ||
const body = { | ||
channel_id: channelId, | ||
text: 'help', | ||
user_id: userId, | ||
}; | ||
|
||
// When | ||
const response = await fetch('/api/v1/homer/command', { | ||
body, | ||
headers: getSlackHeaders(body), | ||
}); | ||
const slackMessage = await response.json(); | ||
|
||
// Then | ||
expect(response.status).toEqual(HTTP_STATUS_OK); | ||
expect(slackMessage.text).toContain('Here are the available commands:'); | ||
expect(slackMessage.text).toContain( | ||
"Don't hesitate to join me on #support-homer to take a beer!" | ||
); | ||
}); | ||
}); |
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
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
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
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