diff options
Diffstat (limited to 'server/tests/api/search/search-channels.ts')
-rw-r--r-- | server/tests/api/search/search-channels.ts | 24 |
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 | }) |