aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils/videos/video-comments.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-01-04 11:19:16 +0100
committerChocobozzz <me@florianbigard.com>2018-01-04 11:19:16 +0100
commit4cb6d4578893db310297d7e118ce2fb7ecb952a3 (patch)
treea89a2e2062ba7bb91e922f07a7950ee51e090ccf /server/tests/utils/videos/video-comments.ts
parentcf117aaafc1e9ae1ab4c388fc5d2e5ba9349efee (diff)
downloadPeerTube-4cb6d4578893db310297d7e118ce2fb7ecb952a3.tar.gz
PeerTube-4cb6d4578893db310297d7e118ce2fb7ecb952a3.tar.zst
PeerTube-4cb6d4578893db310297d7e118ce2fb7ecb952a3.zip
Add ability to delete comments
Diffstat (limited to 'server/tests/utils/videos/video-comments.ts')
-rw-r--r--server/tests/utils/videos/video-comments.ts21
1 files changed, 20 insertions, 1 deletions
diff --git a/server/tests/utils/videos/video-comments.ts b/server/tests/utils/videos/video-comments.ts
index 878147049..1b9ee452e 100644
--- a/server/tests/utils/videos/video-comments.ts
+++ b/server/tests/utils/videos/video-comments.ts
@@ -1,4 +1,5 @@
1import * as request from 'supertest' 1import * as request from 'supertest'
2import { makeDeleteRequest } from '../'
2 3
3function getVideoCommentThreads (url: string, videoId: number | string, start: number, count: number, sort?: string) { 4function getVideoCommentThreads (url: string, videoId: number | string, start: number, count: number, sort?: string) {
4 const path = '/api/v1/videos/' + videoId + '/comment-threads' 5 const path = '/api/v1/videos/' + videoId + '/comment-threads'
@@ -54,11 +55,29 @@ function addVideoCommentReply (
54 .expect(expectedStatus) 55 .expect(expectedStatus)
55} 56}
56 57
58function deleteVideoComment (
59 url: string,
60 token: string,
61 videoId: number | string,
62 commentId: number,
63 statusCodeExpected = 204
64) {
65 const path = '/api/v1/videos/' + videoId + '/comments/' + commentId
66
67 return makeDeleteRequest({
68 url,
69 path,
70 token,
71 statusCodeExpected
72 })
73}
74
57// --------------------------------------------------------------------------- 75// ---------------------------------------------------------------------------
58 76
59export { 77export {
60 getVideoCommentThreads, 78 getVideoCommentThreads,
61 getVideoThreadComments, 79 getVideoThreadComments,
62 addVideoCommentThread, 80 addVideoCommentThread,
63 addVideoCommentReply 81 addVideoCommentReply,
82 deleteVideoComment
64} 83}