- expect(res.body.total).to.equal(1)
- expect(res.body.data).to.be.an('array')
- expect(res.body.data).to.have.lengthOf(1)
- expect(res.body.data[0].name).to.equal('video 1 on server 2')
+ for (const body of [ body1, body2 ]) {
+ expect(body.total).to.equal(1)
+ expect(body.data).to.be.an('array')
+ expect(body.data).to.have.lengthOf(1)
+ expect(body.data[0].name).to.equal('video 1 on server 1')
+ }
+ })
+
+ it('Should search a remote video', async function () {
+ const searches = [
+ 'http://localhost:' + servers[1].port + '/w/' + videoServer2UUID,
+ 'http://localhost:' + servers[1].port + '/videos/watch/' + videoServer2UUID
+ ]
+
+ for (const search of searches) {
+ const body = await command.searchVideos({ search, token: servers[0].accessToken })
+
+ expect(body.total).to.equal(1)
+ expect(body.data).to.be.an('array')
+ expect(body.data).to.have.lengthOf(1)
+ expect(body.data[0].name).to.equal('video 1 on server 2')
+ }