X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fvideos%2Fvideo-change-ownership.ts;h=dee6575b92f6f078943333ca0873f36dc175ac34;hb=c977fd3ec931c059111ddb2b8d6ddbb20b6b99a1;hp=db12206779bce30890ed3e9d5187f0f237ca52d6;hpb=210feb6cc484a6c5c63c98f770de34e223f944cb;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/videos/video-change-ownership.ts b/server/tests/api/videos/video-change-ownership.ts index db1220677..dee6575b9 100644 --- a/server/tests/api/videos/video-change-ownership.ts +++ b/server/tests/api/videos/video-change-ownership.ts @@ -1,10 +1,11 @@ -/* tslint:disable:no-unused-expression */ +/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import * as chai from 'chai' import 'mocha' import { acceptChangeOwnership, changeVideoOwnership, + cleanupTests, createUser, doubleFollow, flushAndRunMultipleServers, @@ -13,7 +14,6 @@ import { getVideo, getVideoChangeOwnershipList, getVideosList, - killallServers, refuseChangeOwnership, ServerInfo, setAccessTokensToServers, @@ -38,7 +38,7 @@ describe('Test video change ownership - nominal', function () { } let firstUserAccessToken = '' let secondUserAccessToken = '' - let lastRequestChangeOwnershipId = undefined + let lastRequestChangeOwnershipId = '' before(async function () { this.timeout(50000) @@ -48,15 +48,15 @@ describe('Test video change ownership - nominal', function () { const videoQuota = 42000000 await createUser({ - url: servers[ 0 ].url, - accessToken: servers[ 0 ].accessToken, + url: servers[0].url, + accessToken: servers[0].accessToken, username: firstUser.username, password: firstUser.password, videoQuota: videoQuota }) await createUser({ - url: servers[ 0 ].url, - accessToken: servers[ 0 ].accessToken, + url: servers[0].url, + accessToken: servers[0].accessToken, username: secondUser.username, password: secondUser.password, videoQuota: videoQuota @@ -191,7 +191,7 @@ describe('Test video change ownership - nominal', function () { await waitJobs(servers) }) - it('Should have video channel updated', async function () { + it('Should have the channel of the video updated', async function () { for (const server of servers) { const res = await getVideo(server.url, servers[0].video.uuid) @@ -203,13 +203,13 @@ describe('Test video change ownership - nominal', function () { } }) - after(function () { - killallServers(servers) + after(async function () { + await cleanupTests(servers) }) }) describe('Test video change ownership - quota too small', function () { - let server: ServerInfo = undefined + let server: ServerInfo const firstUser = { username: 'first', password: 'My great password' @@ -220,14 +220,14 @@ describe('Test video change ownership - quota too small', function () { } let firstUserAccessToken = '' let secondUserAccessToken = '' - let lastRequestChangeOwnershipId = undefined + let lastRequestChangeOwnershipId = '' before(async function () { this.timeout(50000) // Run one server server = await flushAndRunServer(1) - await setAccessTokensToServers([server]) + await setAccessTokensToServers([ server ]) const videoQuota = 42000000 const limitedVideoQuota = 10 @@ -297,7 +297,7 @@ describe('Test video change ownership - quota too small', function () { await acceptChangeOwnership(server.url, secondUserAccessToken, lastRequestChangeOwnershipId, channelId, 403) }) - after(function () { - killallServers([server]) + after(async function () { + await cleanupTests([ server ]) }) })