Skip to content

Commit

Permalink
chore: add e2e test case for notification deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
guqing committed Nov 27, 2023
1 parent 2e86196 commit be0536c
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions e2e/testsuite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ api: |
{{default "http://halo:8090" (env "SERVER")}}/apis
param:
postName: "{{randAlpha 6}}"
userName: "{{randAlpha 6}}"
notificationName: "{{randAlpha 6}}"
auth: "Basic YWRtaW46MTIzNDU2"
items:
- name: init
request:
Expand Down Expand Up @@ -84,3 +87,37 @@ items:
method: DELETE
header:
Authorization: "Basic YWRtaW46MTIzNDU2"

# Notifications
- name: createNotification
request:
api: /notification.halo.run/v1alpha1/notifications
method: POST
body: |
{
"spec": {
"recipient": "{{.param.userName}}",
"reason": "fake-reason",
"title": "test 评论了你的页面《关于我》",
"rawContent": "Fake raw content",
"htmlContent": "<p>Fake html content</p>",
"unread": true
},
"apiVersion": "notification.halo.run/v1alpha1",
"kind": "Notification",
"metadata": {
"name": "{{.param.notificationName}}"
}
}
header:
Content-Type: application/json
Authorization: "{{.param.auth}}"
expect:
statusCode: 201
- name: deleteUserNotification
request:
api: |
/api.notification.halo.run/userspaces/{{.param.userName}}/v1alpha1/notifications/{{.param.notificationName}}
method: DELETE
header:
Authorization: "{{.param.auth}}"

0 comments on commit be0536c

Please sign in to comment.