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 --- server/tests/api/videos/video-channels.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'server/tests/api/videos') diff --git a/server/tests/api/videos/video-channels.ts b/server/tests/api/videos/video-channels.ts index 3493a723d..367f99fdd 100644 --- a/server/tests/api/videos/video-channels.ts +++ b/server/tests/api/videos/video-channels.ts @@ -421,6 +421,32 @@ describe('Test video channels', function () { expect(totoChannel.videosCount).to.equal(0) }) + it('Should search among account video channels', async function () { + { + const res = await getAccountVideoChannelsList({ + url: servers[0].url, + accountName: userInfo.account.name + '@' + userInfo.account.host, + search: 'root' + }) + expect(res.body.total).to.equal(1) + + const channels = res.body.data + expect(channels).to.have.lengthOf(1) + } + + { + const res = await getAccountVideoChannelsList({ + url: servers[0].url, + accountName: userInfo.account.name + '@' + userInfo.account.host, + search: 'does not exist' + }) + expect(res.body.total).to.equal(0) + + const channels = res.body.data + expect(channels).to.have.lengthOf(0) + } + }) + after(async function () { await cleanupTests(servers) }) -- cgit v1.2.3