-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce chat.update bindings (#112)
- Loading branch information
Jade Lovelace
committed
Nov 28, 2022
1 parent
ffeccec
commit 0d6c5f7
Showing
10 changed files
with
244 additions
and
28 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
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,11 @@ | ||
module Web.Slack.ChatSpec (spec) where | ||
|
||
import JSONGolden | ||
import TestImport | ||
import Web.Slack.Chat (UpdateRsp) | ||
|
||
spec :: Spec | ||
spec = describe "Chat methods" do | ||
describe "chat.update" do | ||
describe "Response FromJSON" do | ||
mapM_ (oneGoldenTest @UpdateRsp) ["sample", "actual"] |
78 changes: 78 additions & 0 deletions
78
tests/golden/SlackWebhookEvent/shared_message_no_content.json
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,78 @@ | ||
{ | ||
"token": "aaaa", | ||
"team_id": "T043DB835ML", | ||
"api_app_id": "A0442TUPHGR", | ||
"event": { | ||
"type": "message", | ||
"text": "", | ||
"user": "U043H11ES4V", | ||
"ts": "1668537593.598469", | ||
"team": "T043DB835ML", | ||
"attachments": [ | ||
{ | ||
"from_url": "https://jadeapptesting.slack.com/archives/C043KSKGJUB/p1665615886364019", | ||
"ts": "1665615886.364019", | ||
"author_id": "U043H11ES4V", | ||
"channel_id": "C043KSKGJUB", | ||
"channel_team": "T043DB835ML", | ||
"channel_name": "testing-slack-app", | ||
"is_msg_unfurl": true, | ||
"message_blocks": [ | ||
{ | ||
"team": "T043DB835ML", | ||
"channel": "C043KSKGJUB", | ||
"ts": "1665615886.364019", | ||
"message": { | ||
"blocks": [ | ||
{ | ||
"type": "rich_text", | ||
"block_id": "TNHa4", | ||
"elements": [ | ||
{ | ||
"type": "rich_text_section", | ||
"elements": [ | ||
{ | ||
"type": "text", | ||
"text": "blahblahblahblahblah" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"color": "D0D0D0", | ||
"is_share": true, | ||
"fallback": "[October 12th, 2022 4:04 PM] jadel: blahblahblahblahblah", | ||
"text": "blahblahblahblahblah", | ||
"author_name": "jadel", | ||
"author_link": "https://jadeapptesting.slack.com/team/U043H11ES4V", | ||
"author_icon": "https://secure.gravatar.com/avatar/dcd5bc53dcfaca62ddc3f5726d07ba13.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0019-48.png", | ||
"author_subname": "jadel", | ||
"mrkdwn_in": [ | ||
"text" | ||
], | ||
"footer": "Posted in #testing-slack-app" | ||
} | ||
], | ||
"channel": "C043YJGBY49", | ||
"event_ts": "1668537593.598469", | ||
"channel_type": "channel" | ||
}, | ||
"type": "event_callback", | ||
"event_id": "Ev04BEN3QMSM", | ||
"event_time": 1668537593, | ||
"authorizations": [ | ||
{ | ||
"enterprise_id": null, | ||
"team_id": "T043DB835ML", | ||
"user_id": "U0442US8QGH", | ||
"is_bot": true, | ||
"is_enterprise_install": false | ||
} | ||
], | ||
"is_ext_shared_channel": false, | ||
"event_context": "aaaa" | ||
} |
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,6 @@ | ||
UpdateRsp | ||
{ updateRspChannel = ConversationId | ||
{ unConversationId = "D0442US94JD" } | ||
, updateRspTs = "1668717810.728689" | ||
, updateRspText = "blahblahblah" | ||
} |
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,48 @@ | ||
{ | ||
"ok": true, | ||
"channel": "D0442US94JD", | ||
"ts": "1668717810.728689", | ||
"text": "blahblahblah", | ||
"message": { | ||
"bot_id": "B0439P161B9", | ||
"type": "message", | ||
"text": "blahblahblah", | ||
"user": "U0442US8QGH", | ||
"app_id": "A0442TUPHGR", | ||
"blocks": [ | ||
{ | ||
"type": "rich_text", | ||
"block_id": "j1Bvn", | ||
"elements": [ | ||
{ | ||
"type": "rich_text_section", | ||
"elements": [ | ||
{ | ||
"type": "text", | ||
"text": "blahblahblah" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"team": "T043DB835ML", | ||
"bot_profile": { | ||
"id": "B0439P161B9", | ||
"app_id": "A0442TUPHGR", | ||
"name": "Slacklinker dev", | ||
"icons": { | ||
"image_36": "https://a.slack-edge.com/80588/img/plugins/app/bot_36.png", | ||
"image_48": "https://a.slack-edge.com/80588/img/plugins/app/bot_48.png", | ||
"image_72": "https://a.slack-edge.com/80588/img/plugins/app/service_72.png" | ||
}, | ||
"deleted": false, | ||
"updated": 1663960005, | ||
"team_id": "T043DB835ML" | ||
}, | ||
"edited": { | ||
"user": "B0439P161B9", | ||
"ts": "1668721589.000000" | ||
} | ||
} | ||
} |
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,6 @@ | ||
UpdateRsp | ||
{ updateRspChannel = ConversationId | ||
{ unConversationId = "C024BE91L" } | ||
, updateRspTs = "1401383885.000061" | ||
, updateRspText = "Updated text you carefully authored" | ||
} |
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,10 @@ | ||
{ | ||
"ok": true, | ||
"channel": "C024BE91L", | ||
"ts": "1401383885.000061", | ||
"text": "Updated text you carefully authored", | ||
"message": { | ||
"text": "Updated text you carefully authored", | ||
"user": "U34567890" | ||
} | ||
} |