From 7b3909644dd7cb8be1caad537bb40605e5f059d4 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Mon, 27 Jul 2020 17:00:39 +0200 Subject: test search for subscriptions and video-channels --- shared/extra-utils/users/user-subscriptions.ts | 14 ++++++++++++-- shared/extra-utils/videos/video-channels.ts | 6 ++++-- 2 files changed, 16 insertions(+), 4 deletions(-) (limited to 'shared') diff --git a/shared/extra-utils/users/user-subscriptions.ts b/shared/extra-utils/users/user-subscriptions.ts index 7148fbfca..6d402c073 100644 --- a/shared/extra-utils/users/user-subscriptions.ts +++ b/shared/extra-utils/users/user-subscriptions.ts @@ -12,7 +12,14 @@ function addUserSubscription (url: string, token: string, targetUri: string, sta }) } -function listUserSubscriptions (url: string, token: string, sort = '-createdAt', statusCodeExpected = 200) { +function listUserSubscriptions (parameters: { + url: string + token: string + sort?: string + search?: string + statusCodeExpected?: number +}) { + const { url, token, sort = '-createdAt', search, statusCodeExpected = 200 } = parameters const path = '/api/v1/users/me/subscriptions' return makeGetRequest({ @@ -20,7 +27,10 @@ function listUserSubscriptions (url: string, token: string, sort = '-createdAt', path, token, statusCodeExpected, - query: { sort } + query: { + sort, + search + } }) } diff --git a/shared/extra-utils/videos/video-channels.ts b/shared/extra-utils/videos/video-channels.ts index 55f08b996..97b68178f 100644 --- a/shared/extra-utils/videos/video-channels.ts +++ b/shared/extra-utils/videos/video-channels.ts @@ -32,8 +32,9 @@ function getAccountVideoChannelsList (parameters: { sort?: string specialStatus?: number withStats?: boolean + search?: string }) { - const { url, accountName, start, count, sort = 'createdAt', specialStatus = 200, withStats = false } = parameters + const { url, accountName, start, count, sort = 'createdAt', specialStatus = 200, withStats = false, search } = parameters const path = '/api/v1/accounts/' + accountName + '/video-channels' @@ -44,7 +45,8 @@ function getAccountVideoChannelsList (parameters: { start, count, sort, - withStats + withStats, + search }, statusCodeExpected: specialStatus }) -- cgit v1.2.3