X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fsearch%2Fsearch-videos.ts;h=513538917c1f7e4b4374ac448cc9ca8b1d5cc47c;hb=a2470c9f4bfc7f49f4b94de935bacdd53fd54f29;hp=7dc89c447046eeb9209b73b32f3976087e101968;hpb=65e6e2602c0d5521f3a6740f7469bb92830ecb53;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/search/search-videos.ts b/server/tests/api/search/search-videos.ts index 7dc89c447..513538917 100644 --- a/server/tests/api/search/search-videos.ts +++ b/server/tests/api/search/search-videos.ts @@ -2,23 +2,19 @@ import 'mocha' import * as chai from 'chai' -import { VideoPrivacy } from '@shared/models' import { cleanupTests, - createLive, flushAndRunServer, immutableAssign, SearchCommand, - sendRTMPStreamInVideo, ServerInfo, setAccessTokensToServers, setDefaultVideoChannel, stopFfmpeg, uploadVideo, - wait, - waitUntilLivePublished -} from '../../../../shared/extra-utils' -import { createVideoCaption } from '../../../../shared/extra-utils/videos/video-captions' + wait +} from '@shared/extra-utils' +import { VideoPrivacy } from '@shared/models' const expect = chai.expect @@ -57,18 +53,14 @@ describe('Test videos search', function () { const videoId = res.body.video.id videoUUID = res.body.video.uuid - await createVideoCaption({ - url: server.url, - accessToken: server.accessToken, + await server.captionsCommand.createVideoCaption({ language: 'en', videoId, fixture: 'subtitle-good2.vtt', mimeType: 'application/octet-stream' }) - await createVideoCaption({ - url: server.url, - accessToken: server.accessToken, + await server.captionsCommand.createVideoCaption({ language: 'aa', videoId, fixture: 'subtitle-good2.vtt', @@ -502,12 +494,13 @@ describe('Test videos search', function () { } { - const liveOptions = { name: 'live', privacy: VideoPrivacy.PUBLIC, channelId: server.videoChannel.id } - const resLive = await createLive(server.url, server.accessToken, liveOptions) - const liveVideoId = resLive.body.video.uuid + const liveCommand = server.liveCommand + + const liveAttributes = { name: 'live', privacy: VideoPrivacy.PUBLIC, channelId: server.videoChannel.id } + const live = await liveCommand.create({ fields: liveAttributes }) - const ffmpegCommand = await sendRTMPStreamInVideo(server.url, server.accessToken, liveVideoId) - await waitUntilLivePublished(server.url, server.accessToken, liveVideoId) + const ffmpegCommand = await liveCommand.sendRTMPStreamInVideo({ videoId: live.id }) + await liveCommand.waitUntilPublished({ videoId: live.id }) const body = await command.advancedVideoSearch({ search: { isLive: true } })