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
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 () {
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: {
})
it('Should make an index videos search by default', async function () {
- await server.configCommand.updateCustomSubConfig({
+ await server.config.updateCustomSubConfig({
newConfig: {
search: {
searchIndex: {
})
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: {
let nsfwUUID: string
{
- await server.configCommand.updateCustomSubConfig({
+ await server.config.updateCustomSubConfig({
newConfig: {
instance: { defaultNSFWPolicy: 'display' }
}
}
{
- await server.configCommand.updateCustomSubConfig({
+ await server.config.updateCustomSubConfig({
newConfig: {
instance: { defaultNSFWPolicy: 'do_not_list' }
}