diff options
author | Chocobozzz <me@florianbigard.com> | 2023-01-19 09:28:29 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2023-01-19 13:53:40 +0100 |
commit | b379759f55a35837b803a3b988674972db2903d1 (patch) | |
tree | 895d556973fea9be21492fb60aec2ff7767f5b18 /server/tests/api/users/users.ts | |
parent | 3e5716dd3a5b0db4a1db327714247da687419f92 (diff) | |
download | PeerTube-b379759f55a35837b803a3b988674972db2903d1.tar.gz PeerTube-b379759f55a35837b803a3b988674972db2903d1.tar.zst PeerTube-b379759f55a35837b803a3b988674972db2903d1.zip |
Add signup approval API tests
Diffstat (limited to 'server/tests/api/users/users.ts')
-rw-r--r-- | server/tests/api/users/users.ts | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/server/tests/api/users/users.ts b/server/tests/api/users/users.ts index 93e2e489a..f1e170971 100644 --- a/server/tests/api/users/users.ts +++ b/server/tests/api/users/users.ts | |||
@@ -429,56 +429,6 @@ describe('Test users', function () { | |||
429 | }) | 429 | }) |
430 | }) | 430 | }) |
431 | 431 | ||
432 | describe('Registering a new user', function () { | ||
433 | let user15AccessToken: string | ||
434 | |||
435 | it('Should register a new user', async function () { | ||
436 | const user = { displayName: 'super user 15', username: 'user_15', password: 'my super password' } | ||
437 | const channel = { name: 'my_user_15_channel', displayName: 'my channel rocks' } | ||
438 | |||
439 | await server.users.register({ ...user, channel }) | ||
440 | }) | ||
441 | |||
442 | it('Should be able to login with this registered user', async function () { | ||
443 | const user15 = { | ||
444 | username: 'user_15', | ||
445 | password: 'my super password' | ||
446 | } | ||
447 | |||
448 | user15AccessToken = await server.login.getAccessToken(user15) | ||
449 | }) | ||
450 | |||
451 | it('Should have the correct display name', async function () { | ||
452 | const user = await server.users.getMyInfo({ token: user15AccessToken }) | ||
453 | expect(user.account.displayName).to.equal('super user 15') | ||
454 | }) | ||
455 | |||
456 | it('Should have the correct video quota', async function () { | ||
457 | const user = await server.users.getMyInfo({ token: user15AccessToken }) | ||
458 | expect(user.videoQuota).to.equal(5 * 1024 * 1024) | ||
459 | }) | ||
460 | |||
461 | it('Should have created the channel', async function () { | ||
462 | const { displayName } = await server.channels.get({ channelName: 'my_user_15_channel' }) | ||
463 | |||
464 | expect(displayName).to.equal('my channel rocks') | ||
465 | }) | ||
466 | |||
467 | it('Should remove me', async function () { | ||
468 | { | ||
469 | const { data } = await server.users.list() | ||
470 | expect(data.find(u => u.username === 'user_15')).to.not.be.undefined | ||
471 | } | ||
472 | |||
473 | await server.users.deleteMe({ token: user15AccessToken }) | ||
474 | |||
475 | { | ||
476 | const { data } = await server.users.list() | ||
477 | expect(data.find(u => u.username === 'user_15')).to.be.undefined | ||
478 | } | ||
479 | }) | ||
480 | }) | ||
481 | |||
482 | describe('User blocking', function () { | 432 | describe('User blocking', function () { |
483 | let user16Id: number | 433 | let user16Id: number |
484 | let user16AccessToken: string | 434 | let user16AccessToken: string |