]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/search/search-index.ts
Rename captions commands
[github/Chocobozzz/PeerTube.git] / server / tests / api / search / search-index.ts
index d5dc40f609d163b5b86d7ce597bb5b6cf9f1945a..feb35411f5f51dc1dab6ec6a5bd199d965356cb2 100644 (file)
@@ -2,7 +2,7 @@
 
 import 'mocha'
 import * as chai from 'chai'
-import { cleanupTests, flushAndRunServer, SearchCommand, ServerInfo, setAccessTokensToServers } from '@shared/extra-utils'
+import { cleanupTests, createSingleServer, PeerTubeServer, SearchCommand, setAccessTokensToServers } from '@shared/extra-utils'
 import { BooleanBothQuery, VideoPlaylistPrivacy, VideoPlaylistType, VideosSearchQuery } from '@shared/models'
 
 const expect = chai.expect
@@ -10,19 +10,19 @@ const expect = chai.expect
 describe('Test videos search', function () {
   const localVideoName = 'local video' + new Date().toISOString()
 
-  let server: ServerInfo = null
+  let server: PeerTubeServer = null
   let command: SearchCommand
 
   before(async function () {
     this.timeout(30000)
 
-    server = await flushAndRunServer(1)
+    server = await createSingleServer(1)
 
     await setAccessTokensToServers([ server ])
 
-    await server.videosCommand.upload({ attributes: { name: localVideoName } })
+    await server.videos.upload({ attributes: { name: localVideoName } })
 
-    command = server.searchCommand
+    command = server.search
   })
 
   describe('Default search', async function () {
@@ -30,7 +30,7 @@ describe('Test videos search', function () {
     it('Should make a local videos search by default', async function () {
       this.timeout(10000)
 
-      await server.configCommand.updateCustomSubConfig({
+      await server.config.updateCustomSubConfig({
         newConfig: {
           search: {
             searchIndex: {
@@ -57,7 +57,7 @@ describe('Test videos search', function () {
     })
 
     it('Should make an index videos search by default', async function () {
-      await server.configCommand.updateCustomSubConfig({
+      await server.config.updateCustomSubConfig({
         newConfig: {
           search: {
             searchIndex: {
@@ -79,7 +79,7 @@ describe('Test videos search', function () {
     })
 
     it('Should make an index videos search if local search is disabled', async function () {
-      await server.configCommand.updateCustomSubConfig({
+      await server.config.updateCustomSubConfig({
         newConfig: {
           search: {
             searchIndex: {
@@ -213,7 +213,7 @@ describe('Test videos search', function () {
       let nsfwUUID: string
 
       {
-        await server.configCommand.updateCustomSubConfig({
+        await server.config.updateCustomSubConfig({
           newConfig: {
             instance: { defaultNSFWPolicy: 'display' }
           }
@@ -229,7 +229,7 @@ describe('Test videos search', function () {
       }
 
       {
-        await server.configCommand.updateCustomSubConfig({
+        await server.config.updateCustomSubConfig({
           newConfig: {
             instance: { defaultNSFWPolicy: 'do_not_list' }
           }