diff options
Diffstat (limited to 'server/tests/api/check-params/live.ts')
-rw-r--r-- | server/tests/api/check-params/live.ts | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/server/tests/api/check-params/live.ts b/server/tests/api/check-params/live.ts index 045f3a1b1..78863fd50 100644 --- a/server/tests/api/check-params/live.ts +++ b/server/tests/api/check-params/live.ts | |||
@@ -2,14 +2,11 @@ | |||
2 | 2 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { omit } from 'lodash' | 4 | import { omit } from 'lodash' |
5 | import { VideoCreateResult, VideoPrivacy } from '@shared/models' | 5 | import { HttpStatusCode } from '@shared/core-utils' |
6 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
7 | import { | 6 | import { |
8 | buildAbsoluteFixturePath, | 7 | buildAbsoluteFixturePath, |
9 | cleanupTests, | 8 | cleanupTests, |
10 | createUser, | ||
11 | flushAndRunServer, | 9 | flushAndRunServer, |
12 | getMyUserInformation, | ||
13 | LiveCommand, | 10 | LiveCommand, |
14 | makePostBodyRequest, | 11 | makePostBodyRequest, |
15 | makeUploadRequest, | 12 | makeUploadRequest, |
@@ -18,7 +15,8 @@ import { | |||
18 | setAccessTokensToServers, | 15 | setAccessTokensToServers, |
19 | stopFfmpeg, | 16 | stopFfmpeg, |
20 | uploadVideoAndGetId | 17 | uploadVideoAndGetId |
21 | } from '../../../../shared/extra-utils' | 18 | } from '@shared/extra-utils' |
19 | import { VideoCreateResult, VideoPrivacy } from '@shared/models' | ||
22 | 20 | ||
23 | describe('Test video lives API validator', function () { | 21 | describe('Test video lives API validator', function () { |
24 | const path = '/api/v1/videos/live' | 22 | const path = '/api/v1/videos/live' |
@@ -51,12 +49,12 @@ describe('Test video lives API validator', function () { | |||
51 | 49 | ||
52 | const username = 'user1' | 50 | const username = 'user1' |
53 | const password = 'my super password' | 51 | const password = 'my super password' |
54 | await createUser({ url: server.url, accessToken: server.accessToken, username: username, password: password }) | 52 | await server.usersCommand.create({ username: username, password: password }) |
55 | userAccessToken = await server.loginCommand.getAccessToken({ username, password }) | 53 | userAccessToken = await server.loginCommand.getAccessToken({ username, password }) |
56 | 54 | ||
57 | { | 55 | { |
58 | const res = await getMyUserInformation(server.url, server.accessToken) | 56 | const { videoChannels } = await server.usersCommand.getMyInfo() |
59 | channelId = res.body.videoChannels[0].id | 57 | channelId = videoChannels[0].id |
60 | } | 58 | } |
61 | 59 | ||
62 | { | 60 | { |
@@ -147,11 +145,11 @@ describe('Test video lives API validator', function () { | |||
147 | username: 'fake', | 145 | username: 'fake', |
148 | password: 'fake_password' | 146 | password: 'fake_password' |
149 | } | 147 | } |
150 | await createUser({ url: server.url, accessToken: server.accessToken, username: user.username, password: user.password }) | 148 | await server.usersCommand.create({ username: user.username, password: user.password }) |
151 | 149 | ||
152 | const accessTokenUser = await server.loginCommand.getAccessToken(user) | 150 | const accessTokenUser = await server.loginCommand.getAccessToken(user) |
153 | const res = await getMyUserInformation(server.url, accessTokenUser) | 151 | const { videoChannels } = await server.usersCommand.getMyInfo({ token: accessTokenUser }) |
154 | const customChannelId = res.body.videoChannels[0].id | 152 | const customChannelId = videoChannels[0].id |
155 | 153 | ||
156 | const fields = { ...baseCorrectParams, channelId: customChannelId } | 154 | const fields = { ...baseCorrectParams, channelId: customChannelId } |
157 | 155 | ||