From 22834691abb6e74d31654ffd2ebeaaaa8ef3ac7b Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 9 Apr 2019 11:21:36 +0200 Subject: Add check params account ratings tests --- shared/utils/users/accounts.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'shared/utils') diff --git a/shared/utils/users/accounts.ts b/shared/utils/users/accounts.ts index 54d66ac2a..f64a2dbad 100644 --- a/shared/utils/users/accounts.ts +++ b/shared/utils/users/accounts.ts @@ -7,6 +7,7 @@ import { join } from 'path' import { Account } from '../../models/actors' import { root } from '../miscs/miscs' import { makeGetRequest } from '../requests/requests' +import { VideoRateType } from '../../models/videos' function getAccountsList (url: string, sort = '-createdAt', statusCodeExpected = 200) { const path = '/api/v1/accounts' @@ -54,9 +55,11 @@ async function checkActorFilesWereRemoved (actorUUID: string, serverNumber: numb } } -function getAccountRatings (url: string, accountName: string, accessToken: string, statusCodeExpected = 200, query = {}) { +function getAccountRatings (url: string, accountName: string, accessToken: string, rating?: VideoRateType, statusCodeExpected = 200) { const path = '/api/v1/accounts/' + accountName + '/ratings' + const query = rating ? { rating } : {} + return request(url) .get(path) .query(query) -- cgit v1.2.3