aboutsummaryrefslogtreecommitdiffhomepage
path: root/packages/tests/src/cli/reset-password.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/tests/src/cli/reset-password.ts')
-rw-r--r--packages/tests/src/cli/reset-password.ts26
1 files changed, 26 insertions, 0 deletions
diff --git a/packages/tests/src/cli/reset-password.ts b/packages/tests/src/cli/reset-password.ts
new file mode 100644
index 000000000..62e1a37a0
--- /dev/null
+++ b/packages/tests/src/cli/reset-password.ts
@@ -0,0 +1,26 @@
1import { cleanupTests, CLICommand, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@peertube/peertube-server-commands'
2
3describe('Test reset password scripts', function () {
4 let server: PeerTubeServer
5
6 before(async function () {
7 this.timeout(30000)
8 server = await createSingleServer(1)
9 await setAccessTokensToServers([ server ])
10
11 await server.users.create({ username: 'user_1', password: 'super password' })
12 })
13
14 it('Should change the user password from CLI', async function () {
15 this.timeout(60000)
16
17 const env = server.cli.getEnv()
18 await CLICommand.exec(`echo coucou | ${env} npm run reset-password -- -u user_1`)
19
20 await server.login.login({ user: { username: 'user_1', password: 'coucou' } })
21 })
22
23 after(async function () {
24 await cleanupTests([ server ])
25 })
26})