import * as request from 'supertest'
import { makeDeleteRequest, makeGetRequest } from '../requests/requests'
+import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
function getAdminVideoComments (options: {
url: string
path,
token,
query,
- statusCodeExpected: 200
+ statusCodeExpected: HttpStatusCode.OK_200
})
}
if (token) req.set('Authorization', 'Bearer ' + token)
return req.set('Accept', 'application/json')
- .expect(200)
+ .expect(HttpStatusCode.OK_200)
.expect('Content-Type', /json/)
}
if (token) req.set('Authorization', 'Bearer ' + token)
- return req.expect(200)
+ return req.expect(HttpStatusCode.OK_200)
.expect('Content-Type', /json/)
}
-function addVideoCommentThread (url: string, token: string, videoId: number | string, text: string, expectedStatus = 200) {
+function addVideoCommentThread (
+ url: string,
+ token: string,
+ videoId: number | string,
+ text: string,
+ expectedStatus = HttpStatusCode.OK_200
+) {
const path = '/api/v1/videos/' + videoId + '/comment-threads'
return request(url)
videoId: number | string,
inReplyToCommentId: number,
text: string,
- expectedStatus = 200
+ expectedStatus = HttpStatusCode.OK_200
) {
const path = '/api/v1/videos/' + videoId + '/comments/' + inReplyToCommentId
token: string,
videoId: number | string,
commentId: number,
- statusCodeExpected = 204
+ statusCodeExpected = HttpStatusCode.NO_CONTENT_204
) {
const path = '/api/v1/videos/' + videoId + '/comments/' + commentId