aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/upload-quota.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-08 16:49:51 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commit6910f20f114b5bd020258a3a9a3f2117819a60c2 (patch)
tree0f50d33e20814b581dd9b2c175e511ac7a66f8df /server/tests/api/check-params/upload-quota.ts
parent313228e9c3b5bcef5391228c9b949d05d32ad7bb (diff)
downloadPeerTube-6910f20f114b5bd020258a3a9a3f2117819a60c2.tar.gz
PeerTube-6910f20f114b5bd020258a3a9a3f2117819a60c2.tar.zst
PeerTube-6910f20f114b5bd020258a3a9a3f2117819a60c2.zip
Introduce import command
Diffstat (limited to 'server/tests/api/check-params/upload-quota.ts')
-rw-r--r--server/tests/api/check-params/upload-quota.ts16
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 @@
3import 'mocha' 3import 'mocha'
4import { expect } from 'chai' 4import { expect } from 'chai'
5import { HttpStatusCode, randomInt } from '@shared/core-utils' 5import { HttpStatusCode, randomInt } from '@shared/core-utils'
6import { getGoodVideoUrl, getMagnetURI, getMyVideoImports, importVideo } from '@shared/extra-utils/videos/video-imports' 6import { MyUser, VideoImportState, VideoPrivacy } from '@shared/models'
7import { MyUser, VideoImport, VideoImportState, VideoPrivacy } from '@shared/models'
8import { 7import {
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) {