X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fserver%2Fjobs.ts;h=0c44e4dadc68c384ee5c9f870eeee6601b0a6016;hb=89d241a79c262b9775c233b73cff080043ebb5e6;hp=6854568d3c352f8c07cd6b10e974b447b97d754f;hpb=7926c5f9b3ffcabb1ffb0dcfa5e48b8e0b88fbc0;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/server/jobs.ts b/server/tests/api/server/jobs.ts index 6854568d3..0c44e4dad 100644 --- a/server/tests/api/server/jobs.ts +++ b/server/tests/api/server/jobs.ts @@ -9,7 +9,6 @@ import { flushAndRunMultipleServers, ServerInfo, setAccessTokensToServers, - uploadVideo, waitJobs } from '@shared/extra-utils' @@ -32,21 +31,21 @@ describe('Test jobs', function () { it('Should create some jobs', async function () { this.timeout(120000) - await uploadVideo(servers[1].url, servers[1].accessToken, { name: 'video1' }) - await uploadVideo(servers[1].url, servers[1].accessToken, { name: 'video2' }) + await servers[1].videos.upload({ attributes: { name: 'video1' } }) + await servers[1].videos.upload({ attributes: { name: 'video2' } }) await waitJobs(servers) }) it('Should list jobs', async function () { - const body = await servers[1].jobsCommand.getJobsList({ state: 'completed' }) + const body = await servers[1].jobs.getJobsList({ state: 'completed' }) expect(body.total).to.be.above(2) expect(body.data).to.have.length.above(2) }) it('Should list jobs with sort, pagination and job type', async function () { { - const body = await servers[1].jobsCommand.getJobsList({ + const body = await servers[1].jobs.getJobsList({ state: 'completed', start: 1, count: 2, @@ -67,7 +66,7 @@ describe('Test jobs', function () { } { - const body = await servers[1].jobsCommand.getJobsList({ + const body = await servers[1].jobs.getJobsList({ state: 'completed', start: 0, count: 100, @@ -83,7 +82,7 @@ describe('Test jobs', function () { }) it('Should list all jobs', async function () { - const body = await servers[1].jobsCommand.getJobsList() + const body = await servers[1].jobs.getJobsList() expect(body.total).to.be.above(2) const jobs = body.data