mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
webhooks: Add support for GitHub discussions messages.
We aim to use Zulip topics thoughtfully in displaying messages from discussions, as well as linking to the discussion in every message so that it's easy to view them. Fixes #19938.
This commit is contained in:
@@ -12,6 +12,7 @@ TOPIC_DEPLOYMENT = "public-repo / Deployment on production"
|
||||
TOPIC_ORGANIZATION = "baxterandthehackers organization"
|
||||
TOPIC_BRANCH = "public-repo / changes"
|
||||
TOPIC_WIKI = "public-repo / wiki pages"
|
||||
TOPIC_DISCUSSION = "public-repo discussion #90: Welcome to discussions!"
|
||||
|
||||
|
||||
class GitHubWebhookTest(WebhookTestCase):
|
||||
@@ -483,3 +484,11 @@ A temporary team so that I can get some webhook fixtures!
|
||||
msg,
|
||||
)
|
||||
self.assertTrue(stack_info)
|
||||
|
||||
def test_discussion_msg(self) -> None:
|
||||
expected_message = "Codertocat started a new discussion [Welcome to discussions!](https://github.com/baxterthehacker/public-repo/discussions/90) in General:\n```quote\nWe're glad to have you here!\n```"
|
||||
self.check_webhook("discussion", TOPIC_DISCUSSION, expected_message)
|
||||
|
||||
def test_discussion_comment_msg(self) -> None:
|
||||
expected_message = "Codertocat [commented](https://github.com/baxterthehacker/public-repo/discussions/90#discussioncomment-544078) on [discussion](https://github.com/baxterthehacker/public-repo/discussions/90):\n```quote\nI have so many questions to ask you!\n```"
|
||||
self.check_webhook("discussion_comment", TOPIC_DISCUSSION, expected_message)
|
||||
|
||||
Reference in New Issue
Block a user