diff options
Diffstat (limited to 'server/tests/api/check-params/upload-quota.ts')
-rw-r--r-- | server/tests/api/check-params/upload-quota.ts | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/server/tests/api/check-params/upload-quota.ts b/server/tests/api/check-params/upload-quota.ts index d0fbec415..c444663b8 100644 --- a/server/tests/api/check-params/upload-quota.ts +++ b/server/tests/api/check-params/upload-quota.ts | |||
@@ -3,13 +3,12 @@ | |||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { expect } from 'chai' | 4 | import { expect } from 'chai' |
5 | import { HttpStatusCode, randomInt } from '@shared/core-utils' | 5 | import { HttpStatusCode, randomInt } from '@shared/core-utils' |
6 | import { getGoodVideoUrl, getMagnetURI, getMyVideoImports, importVideo } from '@shared/extra-utils/videos/video-imports' | 6 | import { MyUser, VideoImportState, VideoPrivacy } from '@shared/models' |
7 | import { MyUser, VideoImport, VideoImportState, VideoPrivacy } from '@shared/models' | ||
8 | import { | 7 | import { |
9 | cleanupTests, | 8 | cleanupTests, |
10 | flushAndRunServer, | 9 | flushAndRunServer, |
11 | getMyUserInformation, | 10 | getMyUserInformation, |
12 | immutableAssign, | 11 | ImportsCommand, |
13 | registerUser, | 12 | registerUser, |
14 | ServerInfo, | 13 | ServerInfo, |
15 | setAccessTokensToServers, | 14 | setAccessTokensToServers, |
@@ -83,16 +82,15 @@ describe('Test upload quota', function () { | |||
83 | channelId: server.videoChannel.id, | 82 | channelId: server.videoChannel.id, |
84 | privacy: VideoPrivacy.PUBLIC | 83 | privacy: VideoPrivacy.PUBLIC |
85 | } | 84 | } |
86 | await importVideo(server.url, server.accessToken, immutableAssign(baseAttributes, { targetUrl: getGoodVideoUrl() })) | 85 | await server.importsCommand.importVideo({ attributes: { ...baseAttributes, targetUrl: ImportsCommand.getGoodVideoUrl() } }) |
87 | await importVideo(server.url, server.accessToken, immutableAssign(baseAttributes, { magnetUri: getMagnetURI() })) | 86 | await server.importsCommand.importVideo({ attributes: { ...baseAttributes, magnetUri: ImportsCommand.getMagnetURI() } }) |
88 | await importVideo(server.url, server.accessToken, immutableAssign(baseAttributes, { torrentfile: 'video-720p.torrent' as any })) | 87 | await server.importsCommand.importVideo({ attributes: { ...baseAttributes, torrentfile: 'video-720p.torrent' as any } }) |
89 | 88 | ||
90 | await waitJobs([ server ]) | 89 | await waitJobs([ server ]) |
91 | 90 | ||
92 | const res = await getMyVideoImports(server.url, server.accessToken) | 91 | const { total, data: videoImports } = await server.importsCommand.getMyVideoImports() |
92 | expect(total).to.equal(3) | ||
93 | 93 | ||
94 | expect(res.body.total).to.equal(3) | ||
95 | const videoImports: VideoImport[] = res.body.data | ||
96 | expect(videoImports).to.have.lengthOf(3) | 94 | expect(videoImports).to.have.lengthOf(3) |
97 | 95 | ||
98 | for (const videoImport of videoImports) { | 96 | for (const videoImport of videoImports) { |