From 4cb6d4578893db310297d7e118ce2fb7ecb952a3 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 4 Jan 2018 11:19:16 +0100 Subject: Add ability to delete comments --- server/tests/utils/videos/video-comments.ts | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'server/tests/utils/videos') 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 @@ import * as request from 'supertest' +import { makeDeleteRequest } from '../' function getVideoCommentThreads (url: string, videoId: number | string, start: number, count: number, sort?: string) { const path = '/api/v1/videos/' + videoId + '/comment-threads' @@ -54,11 +55,29 @@ function addVideoCommentReply ( .expect(expectedStatus) } +function deleteVideoComment ( + url: string, + token: string, + videoId: number | string, + commentId: number, + statusCodeExpected = 204 +) { + const path = '/api/v1/videos/' + videoId + '/comments/' + commentId + + return makeDeleteRequest({ + url, + path, + token, + statusCodeExpected + }) +} + // --------------------------------------------------------------------------- export { getVideoCommentThreads, getVideoThreadComments, addVideoCommentThread, - addVideoCommentReply + addVideoCommentReply, + deleteVideoComment } -- cgit v1.2.3