diff options
Diffstat (limited to 'server/tests/api/users/users.ts')
-rw-r--r-- | server/tests/api/users/users.ts | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/server/tests/api/users/users.ts b/server/tests/api/users/users.ts index c8e32f3f5..9d2ef786f 100644 --- a/server/tests/api/users/users.ts +++ b/server/tests/api/users/users.ts | |||
@@ -31,7 +31,8 @@ import { | |||
31 | updateMyUser, | 31 | updateMyUser, |
32 | updateUser, | 32 | updateUser, |
33 | uploadVideo, | 33 | uploadVideo, |
34 | userLogin | 34 | userLogin, |
35 | registerUserWithChannel, getVideoChannel | ||
35 | } from '../../../../shared/extra-utils' | 36 | } from '../../../../shared/extra-utils' |
36 | import { follow } from '../../../../shared/extra-utils/server/follows' | 37 | import { follow } from '../../../../shared/extra-utils/server/follows' |
37 | import { setAccessTokensToServers } from '../../../../shared/extra-utils/users/login' | 38 | import { setAccessTokensToServers } from '../../../../shared/extra-utils/users/login' |
@@ -316,7 +317,7 @@ describe('Test users', function () { | |||
316 | 317 | ||
317 | const rootUser = users[ 1 ] | 318 | const rootUser = users[ 1 ] |
318 | expect(rootUser.username).to.equal('root') | 319 | expect(rootUser.username).to.equal('root') |
319 | expect(rootUser.email).to.equal('admin1@example.com') | 320 | expect(rootUser.email).to.equal('admin' + server.internalServerNumber + '@example.com') |
320 | expect(user.nsfwPolicy).to.equal('display') | 321 | expect(user.nsfwPolicy).to.equal('display') |
321 | 322 | ||
322 | userId = user.id | 323 | userId = user.id |
@@ -334,7 +335,7 @@ describe('Test users', function () { | |||
334 | 335 | ||
335 | const user = users[ 0 ] | 336 | const user = users[ 0 ] |
336 | expect(user.username).to.equal('root') | 337 | expect(user.username).to.equal('root') |
337 | expect(user.email).to.equal('admin1@example.com') | 338 | expect(user.email).to.equal('admin' + server.internalServerNumber + '@example.com') |
338 | expect(user.roleLabel).to.equal('Administrator') | 339 | expect(user.roleLabel).to.equal('Administrator') |
339 | expect(user.nsfwPolicy).to.equal('display') | 340 | expect(user.nsfwPolicy).to.equal('display') |
340 | }) | 341 | }) |
@@ -379,7 +380,7 @@ describe('Test users', function () { | |||
379 | expect(users.length).to.equal(2) | 380 | expect(users.length).to.equal(2) |
380 | 381 | ||
381 | expect(users[ 0 ].username).to.equal('root') | 382 | expect(users[ 0 ].username).to.equal('root') |
382 | expect(users[ 0 ].email).to.equal('admin1@example.com') | 383 | expect(users[ 0 ].email).to.equal('admin' + server.internalServerNumber + '@example.com') |
383 | expect(users[ 0 ].nsfwPolicy).to.equal('display') | 384 | expect(users[ 0 ].nsfwPolicy).to.equal('display') |
384 | 385 | ||
385 | expect(users[ 1 ].username).to.equal('user_1') | 386 | expect(users[ 1 ].username).to.equal('user_1') |
@@ -617,7 +618,10 @@ describe('Test users', function () { | |||
617 | 618 | ||
618 | describe('Registering a new user', function () { | 619 | describe('Registering a new user', function () { |
619 | it('Should register a new user', async function () { | 620 | it('Should register a new user', async function () { |
620 | await registerUser(server.url, 'user_15', 'my super password') | 621 | const user = { username: 'user_15', password: 'my super password' } |
622 | const channel = { name: 'my_user_15_channel', displayName: 'my channel rocks' } | ||
623 | |||
624 | await registerUserWithChannel({ url: server.url, user, channel }) | ||
621 | }) | 625 | }) |
622 | 626 | ||
623 | it('Should be able to login with this registered user', async function () { | 627 | it('Should be able to login with this registered user', async function () { |
@@ -636,6 +640,12 @@ describe('Test users', function () { | |||
636 | expect(user.videoQuota).to.equal(5 * 1024 * 1024) | 640 | expect(user.videoQuota).to.equal(5 * 1024 * 1024) |
637 | }) | 641 | }) |
638 | 642 | ||
643 | it('Should have created the channel', async function () { | ||
644 | const res = await getVideoChannel(server.url, 'my_user_15_channel') | ||
645 | |||
646 | expect(res.body.displayName).to.equal('my channel rocks') | ||
647 | }) | ||
648 | |||
639 | it('Should remove me', async function () { | 649 | it('Should remove me', async function () { |
640 | { | 650 | { |
641 | const res = await getUsersList(server.url, server.accessToken) | 651 | const res = await getUsersList(server.url, server.accessToken) |