From cca1e13b96799377f19bcc95110fbf76ff741e20 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 30 Dec 2019 14:31:39 +0100 Subject: Add test to search in my videos --- server/tests/api/users/users.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'server/tests/api') diff --git a/server/tests/api/users/users.ts b/server/tests/api/users/users.ts index ca06942e7..07b7fc747 100644 --- a/server/tests/api/users/users.ts +++ b/server/tests/api/users/users.ts @@ -309,6 +309,24 @@ describe('Test users', function () { expect(video.thumbnailPath).to.not.be.null expect(video.previewPath).to.not.be.null }) + + it('Should be able to search in my videos', async function () { + { + const res = await getMyVideos(server.url, accessTokenUser, 0, 5, '-createdAt', 'user video') + expect(res.body.total).to.equal(1) + + const videos = res.body.data + expect(videos).to.have.lengthOf(1) + } + + { + const res = await getMyVideos(server.url, accessTokenUser, 0, 5, '-createdAt', 'toto') + expect(res.body.total).to.equal(0) + + const videos = res.body.data + expect(videos).to.have.lengthOf(0) + } + }) }) describe('Users listing', function () { -- cgit v1.2.3