aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/users/users.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-01-08 12:53:09 +0100
committerChocobozzz <me@florianbigard.com>2018-01-08 12:53:09 +0100
commitce5496d6a31b9617aba67970f5dc135e73335234 (patch)
treeb5d2578f4618b71632e92838c3ceae36aa102798 /server/tests/api/users/users.ts
parent108af66140713c4beec681a71d360ab788226528 (diff)
downloadPeerTube-ce5496d6a31b9617aba67970f5dc135e73335234.tar.gz
PeerTube-ce5496d6a31b9617aba67970f5dc135e73335234.tar.zst
PeerTube-ce5496d6a31b9617aba67970f5dc135e73335234.zip
Support video quota on client
Diffstat (limited to 'server/tests/api/users/users.ts')
-rw-r--r--server/tests/api/users/users.ts13
1 files changed, 11 insertions, 2 deletions
diff --git a/server/tests/api/users/users.ts b/server/tests/api/users/users.ts
index f7e5972d3..b788637e7 100644
--- a/server/tests/api/users/users.ts
+++ b/server/tests/api/users/users.ts
@@ -4,7 +4,8 @@ import * as chai from 'chai'
4import 'mocha' 4import 'mocha'
5import { UserRole } from '../../../../shared/index' 5import { UserRole } from '../../../../shared/index'
6import { 6import {
7 createUser, flushTests, getBlacklistedVideosList, getMyUserInformation, getMyUserVideoRating, getUserInformation, getUsersList, 7 createUser, flushTests, getBlacklistedVideosList, getMyUserInformation, getMyUserVideoQuotaUsed, getMyUserVideoRating, getUserInformation,
8 getUsersList,
8 getUsersListPaginationAndSort, getVideosList, killallServers, login, makePutBodyRequest, rateVideo, registerUser, removeUser, removeVideo, 9 getUsersListPaginationAndSort, getVideosList, killallServers, login, makePutBodyRequest, rateVideo, registerUser, removeUser, removeVideo,
9 runServer, ServerInfo, serverLogin, testVideoImage, updateMyAvatar, updateMyUser, updateUser, uploadVideo 10 runServer, ServerInfo, serverLogin, testVideoImage, updateMyAvatar, updateMyUser, updateUser, uploadVideo
10} from '../../utils/index' 11} from '../../utils/index'
@@ -179,11 +180,19 @@ describe('Test users', function () {
179 this.timeout(5000) 180 this.timeout(5000)
180 181
181 const videoAttributes = { 182 const videoAttributes = {
182 name: 'super user video' 183 name: 'super user video',
184 fixture: 'video_short.webm'
183 } 185 }
184 await uploadVideo(server.url, accessTokenUser, videoAttributes) 186 await uploadVideo(server.url, accessTokenUser, videoAttributes)
185 }) 187 })
186 188
189 it('Should have video quota updated', async function () {
190 const res = await getMyUserVideoQuotaUsed(server.url, accessTokenUser)
191 const data = res.body
192
193 expect(data.videoQuotaUsed).to.equal(218910)
194 })
195
187 it('Should be able to list my videos', async function () { 196 it('Should be able to list my videos', async function () {
188 const res = await getMyVideos(server.url, accessTokenUser, 0, 5) 197 const res = await getMyVideos(server.url, accessTokenUser, 0, 5)
189 expect(res.body.total).to.equal(1) 198 expect(res.body.total).to.equal(1)