aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/search
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-08 10:18:40 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:17 +0200
commit4f2199144e428c16460750305f737b890c1ac322 (patch)
treea19c5c0f254ab0b32d6c8838af33a1ba260e4877 /server/tests/api/search
parent2c27e70471120c92e0bc8c8114141fbb31ff98ac (diff)
downloadPeerTube-4f2199144e428c16460750305f737b890c1ac322.tar.gz
PeerTube-4f2199144e428c16460750305f737b890c1ac322.tar.zst
PeerTube-4f2199144e428c16460750305f737b890c1ac322.zip
Introduce live command
Diffstat (limited to 'server/tests/api/search')
-rw-r--r--server/tests/api/search/search-videos.ts22
1 files changed, 10 insertions, 12 deletions
diff --git a/server/tests/api/search/search-videos.ts b/server/tests/api/search/search-videos.ts
index 7dc89c447..af74b26a7 100644
--- a/server/tests/api/search/search-videos.ts
+++ b/server/tests/api/search/search-videos.ts
@@ -2,23 +2,20 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { VideoPrivacy } from '@shared/models'
6import { 5import {
7 cleanupTests, 6 cleanupTests,
8 createLive, 7 createVideoCaption,
9 flushAndRunServer, 8 flushAndRunServer,
10 immutableAssign, 9 immutableAssign,
11 SearchCommand, 10 SearchCommand,
12 sendRTMPStreamInVideo,
13 ServerInfo, 11 ServerInfo,
14 setAccessTokensToServers, 12 setAccessTokensToServers,
15 setDefaultVideoChannel, 13 setDefaultVideoChannel,
16 stopFfmpeg, 14 stopFfmpeg,
17 uploadVideo, 15 uploadVideo,
18 wait, 16 wait
19 waitUntilLivePublished 17} from '@shared/extra-utils'
20} from '../../../../shared/extra-utils' 18import { VideoPrivacy } from '@shared/models'
21import { createVideoCaption } from '../../../../shared/extra-utils/videos/video-captions'
22 19
23const expect = chai.expect 20const expect = chai.expect
24 21
@@ -502,12 +499,13 @@ describe('Test videos search', function () {
502 } 499 }
503 500
504 { 501 {
505 const liveOptions = { name: 'live', privacy: VideoPrivacy.PUBLIC, channelId: server.videoChannel.id } 502 const liveCommand = server.liveCommand
506 const resLive = await createLive(server.url, server.accessToken, liveOptions) 503
507 const liveVideoId = resLive.body.video.uuid 504 const liveAttributes = { name: 'live', privacy: VideoPrivacy.PUBLIC, channelId: server.videoChannel.id }
505 const live = await liveCommand.createLive({ fields: liveAttributes })
508 506
509 const ffmpegCommand = await sendRTMPStreamInVideo(server.url, server.accessToken, liveVideoId) 507 const ffmpegCommand = await liveCommand.sendRTMPStreamInVideo({ videoId: live.id })
510 await waitUntilLivePublished(server.url, server.accessToken, liveVideoId) 508 await liveCommand.waitUntilLivePublished({ videoId: live.id })
511 509
512 const body = await command.advancedVideoSearch({ search: { isLive: true } }) 510 const body = await command.advancedVideoSearch({ search: { isLive: true } })
513 511