aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/search
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-29 10:27:24 +0200
committerChocobozzz <me@florianbigard.com>2021-07-29 10:27:24 +0200
commitb033851fb54241bb703f86add025229e68cc6f59 (patch)
treed60dac1499a95bf9dc902dee24f325fe0f8b6acb /server/tests/api/search
parentfbd67e7f386504e50f2504cb6386700a58906f16 (diff)
downloadPeerTube-b033851fb54241bb703f86add025229e68cc6f59.tar.gz
PeerTube-b033851fb54241bb703f86add025229e68cc6f59.tar.zst
PeerTube-b033851fb54241bb703f86add025229e68cc6f59.zip
Search channels against handles and not names
Diffstat (limited to 'server/tests/api/search')
-rw-r--r--server/tests/api/search/search-channels.ts17
1 files changed, 12 insertions, 5 deletions
diff --git a/server/tests/api/search/search-channels.ts b/server/tests/api/search/search-channels.ts
index ef78c0f67..4485c424e 100644
--- a/server/tests/api/search/search-channels.ts
+++ b/server/tests/api/search/search-channels.ts
@@ -122,18 +122,25 @@ describe('Test channels search', function () {
122 122
123 it('Should filter by names', async function () { 123 it('Should filter by names', async function () {
124 { 124 {
125 const body = await command.advancedChannelSearch({ search: { names: [ 'squall_channel', 'zell_channel' ] } }) 125 const body = await command.advancedChannelSearch({ search: { handles: [ 'squall_channel', 'zell_channel' ] } })
126 expect(body.total).to.equal(2) 126 expect(body.total).to.equal(1)
127 expect(body.data).to.have.lengthOf(2) 127 expect(body.data).to.have.lengthOf(1)
128 expect(body.data[0].displayName).to.equal('Squall channel') 128 expect(body.data[0].displayName).to.equal('Squall channel')
129 expect(body.data[1].displayName).to.equal('Zell channel')
130 } 129 }
131 130
132 { 131 {
133 const body = await command.advancedChannelSearch({ search: { names: [ 'chocobozzz_channel' ] } }) 132 const body = await command.advancedChannelSearch({ search: { handles: [ 'chocobozzz_channel' ] } })
134 expect(body.total).to.equal(0) 133 expect(body.total).to.equal(0)
135 expect(body.data).to.have.lengthOf(0) 134 expect(body.data).to.have.lengthOf(0)
136 } 135 }
136
137 {
138 const body = await command.advancedChannelSearch({ search: { handles: [ 'squall_channel', 'zell_channel@' + remoteServer.host ] } })
139 expect(body.total).to.equal(2)
140 expect(body.data).to.have.lengthOf(2)
141 expect(body.data[0].displayName).to.equal('Squall channel')
142 expect(body.data[1].displayName).to.equal('Zell channel')
143 }
137 }) 144 })
138 145
139 after(async function () { 146 after(async function () {