aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/cli
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/cli
parent6c5065a011b099618681a37bd77eaa7bd3db752e (diff)
downloadPeerTube-41d1d075011174e73dccb74006181a92a618d7b4.tar.gz
PeerTube-41d1d075011174e73dccb74006181a92a618d7b4.tar.zst
PeerTube-41d1d075011174e73dccb74006181a92a618d7b4.zip
Introduce login command
Diffstat (limited to 'server/tests/cli')
-rw-r--r--server/tests/cli/peertube.ts3
-rw-r--r--server/tests/cli/reset-password.ts13
2 files changed, 3 insertions, 13 deletions
diff --git a/server/tests/cli/peertube.ts b/server/tests/cli/peertube.ts
index 5ab07edb0..e055b4684 100644
--- a/server/tests/cli/peertube.ts
+++ b/server/tests/cli/peertube.ts
@@ -21,7 +21,6 @@ import {
21 setAccessTokensToServers, 21 setAccessTokensToServers,
22 testHelloWorldRegisteredSettings, 22 testHelloWorldRegisteredSettings,
23 uploadVideoAndGetId, 23 uploadVideoAndGetId,
24 userLogin,
25 waitJobs 24 waitJobs
26} from '../../../shared/extra-utils' 25} from '../../../shared/extra-utils'
27 26
@@ -41,7 +40,7 @@ describe('Test CLI wrapper', function () {
41 40
42 await createUser({ url: server.url, accessToken: server.accessToken, username: 'user_1', password: 'super_password' }) 41 await createUser({ url: server.url, accessToken: server.accessToken, username: 'user_1', password: 'super_password' })
43 42
44 userAccessToken = await userLogin(server, { username: 'user_1', password: 'super_password' }) 43 userAccessToken = await server.loginCommand.getAccessToken({ username: 'user_1', password: 'super_password' })
45 44
46 { 45 {
47 const attributes = { name: 'user_channel', displayName: 'User channel', support: 'super support text' } 46 const attributes = { name: 'user_channel', displayName: 'User channel', support: 'super support text' }
diff --git a/server/tests/cli/reset-password.ts b/server/tests/cli/reset-password.ts
index 97a6eae15..a5f958bf7 100644
--- a/server/tests/cli/reset-password.ts
+++ b/server/tests/cli/reset-password.ts
@@ -1,14 +1,5 @@
1import 'mocha' 1import 'mocha'
2import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' 2import { cleanupTests, CLICommand, createUser, flushAndRunServer, ServerInfo, setAccessTokensToServers } from '../../../shared/extra-utils'
3import {
4 cleanupTests,
5 CLICommand,
6 createUser,
7 flushAndRunServer,
8 login,
9 ServerInfo,
10 setAccessTokensToServers
11} from '../../../shared/extra-utils'
12 3
13describe('Test reset password scripts', function () { 4describe('Test reset password scripts', function () {
14 let server: ServerInfo 5 let server: ServerInfo
@@ -27,7 +18,7 @@ describe('Test reset password scripts', function () {
27 const env = server.cliCommand.getEnv() 18 const env = server.cliCommand.getEnv()
28 await CLICommand.exec(`echo coucou | ${env} npm run reset-password -- -u user_1`) 19 await CLICommand.exec(`echo coucou | ${env} npm run reset-password -- -u user_1`)
29 20
30 await login(server.url, server.client, { username: 'user_1', password: 'coucou' }, HttpStatusCode.OK_200) 21 await server.loginCommand.login({ user: { username: 'user_1', password: 'coucou' } })
31 }) 22 })
32 23
33 after(async function () { 24 after(async function () {