X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fvideos%2Fsingle-server.ts;h=1f366b642f07a3e1d9858f0d3ecd08ea6d54ba5b;hb=7c3b79768bd174b22154e8d2df0b1211e01ee56a;hp=089c3df25990b07f2a831f896b2fb816b1489dff;hpb=be0f59b4eec3c2c4dcd151e2b174be39dff1568e;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/videos/single-server.ts b/server/tests/api/videos/single-server.ts index 089c3df25..1f366b642 100644 --- a/server/tests/api/videos/single-server.ts +++ b/server/tests/api/videos/single-server.ts @@ -6,8 +6,9 @@ import 'mocha' import { VideoPrivacy } from '../../../../shared/models/videos' import { checkVideoFilesWereRemoved, + cleanupTests, completeVideoCheck, - flushTests, + flushAndRunServer, getVideo, getVideoCategories, getVideoLanguages, @@ -17,10 +18,8 @@ import { getVideosListPagination, getVideosListSort, getVideosWithFilters, - killallServers, rateVideo, removeVideo, - runServer, ServerInfo, setAccessTokensToServers, testImage, @@ -28,7 +27,7 @@ import { uploadVideo, viewVideo, wait -} from '../../utils' +} from '../../../../shared/extra-utils' const expect = chai.expect @@ -55,6 +54,7 @@ describe('Test a single server', function () { tags: [ 'tag1', 'tag2', 'tag3' ], privacy: VideoPrivacy.PUBLIC, commentsEnabled: true, + downloadEnabled: true, channel: { displayName: 'Main root channel', name: 'root_channel', @@ -87,6 +87,7 @@ describe('Test a single server', function () { privacy: VideoPrivacy.PUBLIC, duration: 5, commentsEnabled: false, + downloadEnabled: false, channel: { name: 'root_channel', displayName: 'Main root channel', @@ -105,9 +106,7 @@ describe('Test a single server', function () { before(async function () { this.timeout(30000) - await flushTests() - - server = await runServer(1) + server = await flushAndRunServer(1) await setAccessTokensToServers([ server ]) }) @@ -356,6 +355,7 @@ describe('Test a single server', function () { nsfw: false, description: 'my super description updated', commentsEnabled: false, + downloadEnabled: false, tags: [ 'tagup1', 'tagup2' ] } await updateVideo(server.url, server.accessToken, videoId, attributes) @@ -424,11 +424,6 @@ describe('Test a single server', function () { }) after(async function () { - killallServers([ server ]) - - // Keep the logs if the test failed - if (this['ok']) { - await flushTests() - } + await cleanupTests([ server ]) }) })