diff options
author | Chocobozzz <me@florianbigard.com> | 2018-01-04 11:19:16 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-01-04 11:19:16 +0100 |
commit | 4cb6d4578893db310297d7e118ce2fb7ecb952a3 (patch) | |
tree | a89a2e2062ba7bb91e922f07a7950ee51e090ccf /server/tests/utils | |
parent | cf117aaafc1e9ae1ab4c388fc5d2e5ba9349efee (diff) | |
download | PeerTube-4cb6d4578893db310297d7e118ce2fb7ecb952a3.tar.gz PeerTube-4cb6d4578893db310297d7e118ce2fb7ecb952a3.tar.zst PeerTube-4cb6d4578893db310297d7e118ce2fb7ecb952a3.zip |
Add ability to delete comments
Diffstat (limited to 'server/tests/utils')
-rw-r--r-- | server/tests/utils/videos/video-comments.ts | 21 |
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 @@ | |||
1 | import * as request from 'supertest' | 1 | import * as request from 'supertest' |
2 | import { makeDeleteRequest } from '../' | ||
2 | 3 | ||
3 | function getVideoCommentThreads (url: string, videoId: number | string, start: number, count: number, sort?: string) { | 4 | function 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 | ||
58 | function 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 | ||
59 | export { | 77 | export { |
60 | getVideoCommentThreads, | 78 | getVideoCommentThreads, |
61 | getVideoThreadComments, | 79 | getVideoThreadComments, |
62 | addVideoCommentThread, | 80 | addVideoCommentThread, |
63 | addVideoCommentReply | 81 | addVideoCommentReply, |
82 | deleteVideoComment | ||
64 | } | 83 | } |