aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/cli/reset-password.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-05 16:37:50 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:16 +0200
commit329619b3453479f76c049816b7403b86e9d45cb5 (patch)
treee522940946402a4284d356f2cde8e0dcbe29b289 /server/tests/cli/reset-password.ts
parenta6a79eae0d8564099b6957e76d7a18528d9ef124 (diff)
downloadPeerTube-329619b3453479f76c049816b7403b86e9d45cb5.tar.gz
PeerTube-329619b3453479f76c049816b7403b86e9d45cb5.tar.zst
PeerTube-329619b3453479f76c049816b7403b86e9d45cb5.zip
Introduce CLI command
Diffstat (limited to 'server/tests/cli/reset-password.ts')
-rw-r--r--server/tests/cli/reset-password.ts10
1 files changed, 4 insertions, 6 deletions
diff --git a/server/tests/cli/reset-password.ts b/server/tests/cli/reset-password.ts
index a84463b33..97a6eae15 100644
--- a/server/tests/cli/reset-password.ts
+++ b/server/tests/cli/reset-password.ts
@@ -1,16 +1,14 @@
1import 'mocha' 1import 'mocha'
2 2import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
3import { 3import {
4 cleanupTests, 4 cleanupTests,
5 CLICommand,
5 createUser, 6 createUser,
6 execCLI,
7 flushAndRunServer, 7 flushAndRunServer,
8 getEnvCli,
9 login, 8 login,
10 ServerInfo, 9 ServerInfo,
11 setAccessTokensToServers 10 setAccessTokensToServers
12} from '../../../shared/extra-utils' 11} from '../../../shared/extra-utils'
13import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
14 12
15describe('Test reset password scripts', function () { 13describe('Test reset password scripts', function () {
16 let server: ServerInfo 14 let server: ServerInfo
@@ -26,8 +24,8 @@ describe('Test reset password scripts', function () {
26 it('Should change the user password from CLI', async function () { 24 it('Should change the user password from CLI', async function () {
27 this.timeout(60000) 25 this.timeout(60000)
28 26
29 const env = getEnvCli(server) 27 const env = server.cliCommand.getEnv()
30 await execCLI(`echo coucou | ${env} npm run reset-password -- -u user_1`) 28 await CLICommand.exec(`echo coucou | ${env} npm run reset-password -- -u user_1`)
31 29
32 await login(server.url, server.client, { username: 'user_1', password: 'coucou' }, HttpStatusCode.OK_200) 30 await login(server.url, server.client, { username: 'user_1', password: 'coucou' }, HttpStatusCode.OK_200)
33 }) 31 })