]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/search/search-videos.ts
Add ability to search by UUID
[github/Chocobozzz/PeerTube.git] / server / tests / api / search / search-videos.ts
index a3e05156b189dc4d3efd825595f180da0e33d535..7882d93733e71ab457a525181a1efb0940d9b839 100644 (file)
@@ -20,6 +20,7 @@ const expect = chai.expect
 describe('Test videos search', function () {
   let server: ServerInfo = null
   let startDate: string
+  let videoUUID: string
 
   before(async function () {
     this.timeout(30000)
@@ -46,6 +47,7 @@ describe('Test videos search', function () {
         const attributes3 = immutableAssign(attributes1, { name: attributes1.name + ' - 3', language: undefined })
         const res = await uploadVideo(server.url, server.accessToken, attributes3)
         const videoId = res.body.video.id
+        videoUUID = res.body.video.uuid
 
         await createVideoCaption({
           url: server.url,
@@ -439,6 +441,14 @@ describe('Test videos search', function () {
     }
   })
 
+  it('Should search by UUID', async function () {
+    const search = videoUUID
+    const res = await advancedVideosSearch(server.url, { search })
+
+    expect(res.body.total).to.equal(1)
+    expect(res.body.data[0].name).to.equal('1111 2222 3333 - 3')
+  })
+
   after(async function () {
     await cleanupTests([ server ])
   })