aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/cli/reset-password.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-21 15:51:30 +0200
committerChocobozzz <me@florianbigard.com>2021-07-21 15:51:30 +0200
commita24bd1ed41b43790bab6ba789580bb4e85f07d85 (patch)
treea54b0f6c921ba83a6e909cd0ced325b2d4b8863c /server/tests/cli/reset-password.ts
parent5f26f13b3c16ac5ae0a3b0a7142d84a9528cf565 (diff)
parentc63830f15403ac4e750829f27d8bbbdc9a59282c (diff)
downloadPeerTube-a24bd1ed41b43790bab6ba789580bb4e85f07d85.tar.gz
PeerTube-a24bd1ed41b43790bab6ba789580bb4e85f07d85.tar.zst
PeerTube-a24bd1ed41b43790bab6ba789580bb4e85f07d85.zip
Merge branch 'next' into develop
Diffstat (limited to 'server/tests/cli/reset-password.ts')
-rw-r--r--server/tests/cli/reset-password.ts25
1 files changed, 7 insertions, 18 deletions
diff --git a/server/tests/cli/reset-password.ts b/server/tests/cli/reset-password.ts
index a84463b33..4a02db35d 100644
--- a/server/tests/cli/reset-password.ts
+++ b/server/tests/cli/reset-password.ts
@@ -1,35 +1,24 @@
1import 'mocha' 1import 'mocha'
2 2import { cleanupTests, CLICommand, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '../../../shared/extra-utils'
3import {
4 cleanupTests,
5 createUser,
6 execCLI,
7 flushAndRunServer,
8 getEnvCli,
9 login,
10 ServerInfo,
11 setAccessTokensToServers
12} from '../../../shared/extra-utils'
13import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
14 3
15describe('Test reset password scripts', function () { 4describe('Test reset password scripts', function () {
16 let server: ServerInfo 5 let server: PeerTubeServer
17 6
18 before(async function () { 7 before(async function () {
19 this.timeout(30000) 8 this.timeout(30000)
20 server = await flushAndRunServer(1) 9 server = await createSingleServer(1)
21 await setAccessTokensToServers([ server ]) 10 await setAccessTokensToServers([ server ])
22 11
23 await createUser({ url: server.url, accessToken: server.accessToken, username: 'user_1', password: 'super password' }) 12 await server.users.create({ username: 'user_1', password: 'super password' })
24 }) 13 })
25 14
26 it('Should change the user password from CLI', async function () { 15 it('Should change the user password from CLI', async function () {
27 this.timeout(60000) 16 this.timeout(60000)
28 17
29 const env = getEnvCli(server) 18 const env = server.cli.getEnv()
30 await execCLI(`echo coucou | ${env} npm run reset-password -- -u user_1`) 19 await CLICommand.exec(`echo coucou | ${env} npm run reset-password -- -u user_1`)
31 20
32 await login(server.url, server.client, { username: 'user_1', password: 'coucou' }, HttpStatusCode.OK_200) 21 await server.login.login({ user: { username: 'user_1', password: 'coucou' } })
33 }) 22 })
34 23
35 after(async function () { 24 after(async function () {