import * as chai from 'chai'
import { keyBy } from 'lodash'
import 'mocha'
-import { join } from 'path'
import { VideoPrivacy } from '../../../../shared/models/videos'
import {
- dateIsValid,
- flushTests,
- getVideo,
- getVideoCategories,
- getVideoLanguages,
- getVideoLicences,
- getVideoPrivacies,
- getVideosList,
- getVideosListPagination,
- getVideosListSort,
- killallServers,
- rateVideo,
- readdirPromise,
- removeVideo,
- runServer,
- searchVideo,
- searchVideoWithPagination,
- searchVideoWithSort,
- ServerInfo,
- setAccessTokensToServers,
- testVideoImage,
- updateVideo,
- uploadVideo,
- wait,
- webtorrentAdd,
- viewVideo, completeVideoCheck, immutableAssign
+ checkVideoFilesWereRemoved, completeVideoCheck, flushTests, getVideo, getVideoCategories, getVideoLanguages, getVideoLicences,
+ getVideoPrivacies, getVideosList, getVideosListPagination, getVideosListSort, killallServers, rateVideo, removeVideo, runServer,
+ searchVideo, searchVideoWithPagination, searchVideoWithSort, ServerInfo, setAccessTokensToServers, testImage, updateVideo, uploadVideo,
+ viewVideo, wait
} from '../../utils'
const expect = chai.expect
language: 3,
nsfw: true,
description: 'my super description',
+ support: 'my super support text',
host: 'localhost:9001',
account: 'root',
isLocal: true,
duration: 5,
tags: [ 'tag1', 'tag2', 'tag3' ],
privacy: VideoPrivacy.PUBLIC,
+ commentsEnabled: true,
channel: {
name: 'Default root channel',
description: '',
category: 4,
licence: 2,
language: 5,
- nsfw: true,
+ nsfw: false,
description: 'my super description updated',
+ support: 'my super support text updated',
host: 'localhost:9001',
account: 'root',
isLocal: true,
tags: [ 'tagup1', 'tagup2' ],
privacy: VideoPrivacy.PUBLIC,
duration: 5,
+ commentsEnabled: false,
channel: {
name: 'Default root channel',
description: '',
}
before(async function () {
- this.timeout(10000)
+ this.timeout(30000)
await flushTests()
})
it('Should get and seed the uploaded video', async function () {
- // Yes, this could be long
- this.timeout(60000)
+ this.timeout(5000)
const res = await getVideosList(server.url)
})
it('Should get the video by UUID', async function () {
- // Yes, this could be long
- this.timeout(60000)
+ this.timeout(5000)
const res = await getVideo(server.url, videoUUID)
})
it('Should have the views updated', async function () {
+ this.timeout(10000)
+
+ await viewVideo(server.url, videoId)
+ await viewVideo(server.url, videoId)
await viewVideo(server.url, videoId)
+
+ await wait(1500)
+
+ await viewVideo(server.url, videoId)
+ await viewVideo(server.url, videoId)
+
+ await wait(1500)
+
await viewVideo(server.url, videoId)
await viewVideo(server.url, videoId)
it('Should remove the video', async function () {
await removeVideo(server.url, server.accessToken, videoId)
- const files1 = await readdirPromise(join(__dirname, '..', '..', '..', '..', 'test1', 'videos'))
- expect(files1).to.have.lengthOf(0)
-
- const files2 = await readdirPromise(join(__dirname, '..', '..', '..', '..', 'test1', 'thumbnails'))
- expect(files2).to.have.lengthOf(0)
+ await checkVideoFilesWereRemoved(videoUUID, 1)
})
it('Should not have videos', async function () {
for (const video of videos) {
const videoName = video.name.replace(' name', '')
- const test = await testVideoImage(server.url, videoName, video.thumbnailPath)
-
- expect(test).to.equal(true)
+ await testImage(server.url, videoName, video.thumbnailPath)
}
})
language: 5,
nsfw: false,
description: 'my super description updated',
+ commentsEnabled: false,
tags: [ 'tagup1', 'tagup2' ]
}
await updateVideo(server.url, server.accessToken, videoId, attributes)