X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fsearch%2Fsearch-index.ts;h=feb35411f5f51dc1dab6ec6a5bd199d965356cb2;hb=c63830f15403ac4e750829f27d8bbbdc9a59282c;hp=d5dc40f609d163b5b86d7ce597bb5b6cf9f1945a;hpb=d23dd9fbfc4d26026352c10f81d2795ceaf2908a;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/search/search-index.ts b/server/tests/api/search/search-index.ts index d5dc40f60..feb35411f 100644 --- a/server/tests/api/search/search-index.ts +++ b/server/tests/api/search/search-index.ts @@ -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' } }