aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/utils')
-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}