]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/tests/cli/reset-password.ts
Update changelog
[github/Chocobozzz/PeerTube.git] / server / tests / cli / reset-password.ts
CommitLineData
fdbda9e3 1import 'mocha'
c55e3d72 2import { cleanupTests, CLICommand, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands'
fdbda9e3
C
3
4describe('Test reset password scripts', function () {
254d3579 5 let server: PeerTubeServer
fdbda9e3
C
6
7 before(async function () {
8 this.timeout(30000)
254d3579 9 server = await createSingleServer(1)
fdbda9e3
C
10 await setAccessTokensToServers([ server ])
11
89d241a7 12 await server.users.create({ username: 'user_1', password: 'super password' })
fdbda9e3
C
13 })
14
15 it('Should change the user password from CLI', async function () {
0f91ae62 16 this.timeout(60000)
fdbda9e3 17
89d241a7 18 const env = server.cli.getEnv()
329619b3 19 await CLICommand.exec(`echo coucou | ${env} npm run reset-password -- -u user_1`)
fdbda9e3 20
89d241a7 21 await server.login.login({ user: { username: 'user_1', password: 'coucou' } })
fdbda9e3
C
22 })
23
7c3b7976
C
24 after(async function () {
25 await cleanupTests([ server ])
fdbda9e3
C
26 })
27})