aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/search/search-channels.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-28 16:40:21 +0200
committerChocobozzz <me@florianbigard.com>2021-07-28 16:40:21 +0200
commitfbd67e7f386504e50f2504cb6386700a58906f16 (patch)
tree1a7143aaea76ce4e195fb9d6214a0cd769c556ea /server/tests/api/search/search-channels.ts
parent164c8d46cf5c948a28b4ac0e596fad9b83b2c229 (diff)
downloadPeerTube-fbd67e7f386504e50f2504cb6386700a58906f16.tar.gz
PeerTube-fbd67e7f386504e50f2504cb6386700a58906f16.tar.zst
PeerTube-fbd67e7f386504e50f2504cb6386700a58906f16.zip
Add ability to search by uuids/actor names
Diffstat (limited to 'server/tests/api/search/search-channels.ts')
-rw-r--r--server/tests/api/search/search-channels.ts24
1 files changed, 22 insertions, 2 deletions
diff --git a/server/tests/api/search/search-channels.ts b/server/tests/api/search/search-channels.ts
index aab03bfd1..ef78c0f67 100644
--- a/server/tests/api/search/search-channels.ts
+++ b/server/tests/api/search/search-channels.ts
@@ -22,8 +22,12 @@ describe('Test channels search', function () {
22 before(async function () { 22 before(async function () {
23 this.timeout(120000) 23 this.timeout(120000)
24 24
25 server = await createSingleServer(1) 25 const servers = await Promise.all([
26 remoteServer = await createSingleServer(2, { transcoding: { enabled: false } }) 26 createSingleServer(1),
27 createSingleServer(2, { transcoding: { enabled: false } })
28 ])
29 server = servers[0]
30 remoteServer = servers[1]
27 31
28 await setAccessTokensToServers([ server, remoteServer ]) 32 await setAccessTokensToServers([ server, remoteServer ])
29 33
@@ -116,6 +120,22 @@ describe('Test channels search', function () {
116 } 120 }
117 }) 121 })
118 122
123 it('Should filter by names', async function () {
124 {
125 const body = await command.advancedChannelSearch({ search: { names: [ 'squall_channel', 'zell_channel' ] } })
126 expect(body.total).to.equal(2)
127 expect(body.data).to.have.lengthOf(2)
128 expect(body.data[0].displayName).to.equal('Squall channel')
129 expect(body.data[1].displayName).to.equal('Zell channel')
130 }
131
132 {
133 const body = await command.advancedChannelSearch({ search: { names: [ 'chocobozzz_channel' ] } })
134 expect(body.total).to.equal(0)
135 expect(body.data).to.have.lengthOf(0)
136 }
137 })
138
119 after(async function () { 139 after(async function () {
120 await cleanupTests([ server ]) 140 await cleanupTests([ server ])
121 }) 141 })