]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/server/reverse-proxy.ts
Add signup approval API tests
[github/Chocobozzz/PeerTube.git] / server / tests / api / server / reverse-proxy.ts
index 0a1565faff36b0e1cc75d0ac7217cee98e60fdc6..11c96c4b524c755ce0d841a11b2f1f304d794782 100644 (file)
@@ -11,7 +11,7 @@ describe('Test application behind a reverse proxy', function () {
   let videoId: string
 
   before(async function () {
-    this.timeout(30000)
+    this.timeout(60000)
 
     const config = {
       rates_limit: {
@@ -42,7 +42,7 @@ describe('Test application behind a reverse proxy', function () {
   })
 
   it('Should view a video only once with the same IP by default', async function () {
-    this.timeout(20000)
+    this.timeout(40000)
 
     await server.views.simulateView({ id: videoId })
     await server.views.simulateView({ id: videoId })
@@ -106,13 +106,13 @@ describe('Test application behind a reverse proxy', function () {
   it('Should rate limit signup', async function () {
     for (let i = 0; i < 10; i++) {
       try {
-        await server.users.register({ username: 'test' + i })
+        await server.registrations.register({ username: 'test' + i })
       } catch {
         // empty
       }
     }
 
-    await server.users.register({ username: 'test42', expectedStatus: HttpStatusCode.TOO_MANY_REQUESTS_429 })
+    await server.registrations.register({ username: 'test42', expectedStatus: HttpStatusCode.TOO_MANY_REQUESTS_429 })
   })
 
   it('Should not rate limit failed signup', async function () {
@@ -121,10 +121,10 @@ describe('Test application behind a reverse proxy', function () {
     await wait(7000)
 
     for (let i = 0; i < 3; i++) {
-      await server.users.register({ username: 'test' + i, expectedStatus: HttpStatusCode.CONFLICT_409 })
+      await server.registrations.register({ username: 'test' + i, expectedStatus: HttpStatusCode.CONFLICT_409 })
     }
 
-    await server.users.register({ username: 'test43', expectedStatus: HttpStatusCode.NO_CONTENT_204 })
+    await server.registrations.register({ username: 'test43', expectedStatus: HttpStatusCode.NO_CONTENT_204 })
 
   })