aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/videos/video-privacy.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-13 11:05:15 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commit41d1d075011174e73dccb74006181a92a618d7b4 (patch)
tree4dc1af0e266977f062cf9716837d04de1cdd628d /server/tests/api/videos/video-privacy.ts
parent6c5065a011b099618681a37bd77eaa7bd3db752e (diff)
downloadPeerTube-41d1d075011174e73dccb74006181a92a618d7b4.tar.gz
PeerTube-41d1d075011174e73dccb74006181a92a618d7b4.tar.zst
PeerTube-41d1d075011174e73dccb74006181a92a618d7b4.zip
Introduce login command
Diffstat (limited to 'server/tests/api/videos/video-privacy.ts')
-rw-r--r--server/tests/api/videos/video-privacy.ts23
1 files changed, 12 insertions, 11 deletions
diff --git a/server/tests/api/videos/video-privacy.ts b/server/tests/api/videos/video-privacy.ts
index 950aeb7cf..f831dd8a9 100644
--- a/server/tests/api/videos/video-privacy.ts
+++ b/server/tests/api/videos/video-privacy.ts
@@ -2,23 +2,24 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' 5import { HttpStatusCode } from '@shared/core-utils'
6import { Video, VideoCreateResult } from '@shared/models'
7import { 6import {
8 cleanupTests, 7 cleanupTests,
8 createUser,
9 doubleFollow,
9 flushAndRunServer, 10 flushAndRunServer,
11 getMyVideos,
12 getVideo,
10 getVideosList, 13 getVideosList,
11 getVideosListWithToken, 14 getVideosListWithToken,
15 getVideoWithToken,
12 ServerInfo, 16 ServerInfo,
13 setAccessTokensToServers, 17 setAccessTokensToServers,
14 uploadVideo 18 updateVideo,
15} from '../../../../shared/extra-utils/index' 19 uploadVideo,
16import { doubleFollow } from '../../../../shared/extra-utils/server/follows' 20 waitJobs
17import { waitJobs } from '../../../../shared/extra-utils/server/jobs' 21} from '@shared/extra-utils'
18import { userLogin } from '../../../../shared/extra-utils/users/login' 22import { Video, VideoCreateResult, VideoPrivacy } from '@shared/models'
19import { createUser } from '../../../../shared/extra-utils/users/users'
20import { getMyVideos, getVideo, getVideoWithToken, updateVideo } from '../../../../shared/extra-utils/videos/videos'
21import { VideoPrivacy } from '../../../../shared/models/videos/video-privacy.enum'
22 23
23const expect = chai.expect 24const expect = chai.expect
24 25
@@ -126,7 +127,7 @@ describe('Test video privacy', function () {
126 } 127 }
127 await createUser({ url: servers[0].url, accessToken: servers[0].accessToken, username: user.username, password: user.password }) 128 await createUser({ url: servers[0].url, accessToken: servers[0].accessToken, username: user.username, password: user.password })
128 129
129 anotherUserToken = await userLogin(servers[0], user) 130 anotherUserToken = await servers[0].loginCommand.getAccessToken(user)
130 await getVideoWithToken(servers[0].url, anotherUserToken, privateVideoUUID, HttpStatusCode.FORBIDDEN_403) 131 await getVideoWithToken(servers[0].url, anotherUserToken, privateVideoUUID, HttpStatusCode.FORBIDDEN_403)
131 }) 132 })
132 133