diff options
Diffstat (limited to 'server/tests/utils')
-rw-r--r-- | server/tests/utils/server/jobs.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/server/tests/utils/server/jobs.ts b/server/tests/utils/server/jobs.ts index c9cb8d3a3..4c02cace5 100644 --- a/server/tests/utils/server/jobs.ts +++ b/server/tests/utils/server/jobs.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import * as request from 'supertest' | 1 | import * as request from 'supertest' |
2 | import { JobState } from '../../../../shared/models' | 2 | import { Job, JobState } from '../../../../shared/models' |
3 | import { ServerInfo, wait } from '../index' | 3 | import { ServerInfo, wait } from '../index' |
4 | 4 | ||
5 | function getJobsList (url: string, accessToken: string, state: JobState) { | 5 | function getJobsList (url: string, accessToken: string, state: JobState) { |
@@ -44,8 +44,10 @@ async function waitJobs (serversArg: ServerInfo[] | ServerInfo) { | |||
44 | for (const server of servers) { | 44 | for (const server of servers) { |
45 | for (const state of states) { | 45 | for (const state of states) { |
46 | const p = getJobsListPaginationAndSort(server.url, server.accessToken, state, 0, 10, '-createdAt') | 46 | const p = getJobsListPaginationAndSort(server.url, server.accessToken, state, 0, 10, '-createdAt') |
47 | .then(res => { | 47 | .then(res => res.body.data) |
48 | if (res.body.total > 0) pendingRequests = true | 48 | .then((jobs: Job[]) => jobs.filter(j => j.type !== 'videos-views')) |
49 | .then(jobs => { | ||
50 | if (jobs.length !== 0) pendingRequests = true | ||
49 | }) | 51 | }) |
50 | tasks.push(p) | 52 | tasks.push(p) |
51 | } | 53 | } |