Skip to content

Commit f4ef8f9

Browse files
committed
Test creating webhooks and emails
1 parent a94656c commit f4ef8f9

4 files changed

Lines changed: 54 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"body": {
3+
"deliveryMethods": [
4+
{
5+
"config": {
6+
"email": "me@example.com",
7+
"id": "NE-<UUID>"
8+
},
9+
"kind": "email"
10+
},
11+
{
12+
"config": {
13+
"id": "NW-<UUID>",
14+
"url": "https://example.com/webhook"
15+
},
16+
"kind": "webhook"
17+
}
18+
]
19+
},
20+
"status": [
21+
{
22+
"status_code": 200
23+
}
24+
]
25+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"body": {
3+
"emailDeliveryMethodId": "NE-<UUID>"
4+
},
5+
"status": [
6+
{
7+
"status_code": 200
8+
}
9+
]
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"body": {
3+
"webhookDeliveryMethodId": "NW-<UUID>"
4+
},
5+
"status": [
6+
{
7+
"status_code": 200
8+
}
9+
]
10+
}

transcripts/share-apis/notifications/run.zsh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ fetch "$transcripts_user" POST create-subscription-for-other-user-project '/user
2626
]
2727
}"
2828

29+
fetch "$test_user" POST create-email-delivery '/users/test/notifications/delivery-methods/emails' '{
30+
"email": "me@example.com"
31+
}'
32+
33+
fetch "$test_user" POST create-webhook-delivery '/users/test/notifications/delivery-methods/webhooks' '{
34+
"url": "https://example.com/webhook"
35+
}'
36+
37+
fetch "$test_user" GET check-delivery-methods '/users/test/notifications/delivery-methods'
2938

3039
# Create a contribution in a public project, which should trigger a notification for both users
3140
fetch "$test_user" POST public-contribution-create '/users/test/projects/publictestproject/contributions' '{

0 commit comments

Comments
 (0)