]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/check-params/users.ts
Merge branch 'next' into develop
[github/Chocobozzz/PeerTube.git] / server / tests / api / check-params / users.ts
index 34fe309f9edb1eccc26b7a55d0c9e1dd80fecfa3..58b360f9282671cbd6875d791025ab7e7ff0636a 100644 (file)
@@ -2,7 +2,6 @@
 
 import 'mocha'
 import { omit } from 'lodash'
-import { HttpStatusCode } from '@shared/models'
 import {
   buildAbsoluteFixturePath,
   checkBadCountPagination,
@@ -20,7 +19,7 @@ import {
   setAccessTokensToServers,
   UsersCommand
 } from '@shared/extra-utils'
-import { UserAdminFlag, UserRole, VideoCreateResult } from '@shared/models'
+import { HttpStatusCode, UserAdminFlag, UserRole, VideoCreateResult } from '@shared/models'
 
 describe('Test users API validators', function () {
   const path = '/api/v1/users/'
@@ -492,20 +491,20 @@ describe('Test users API validators', function () {
       await makePutBodyRequest({ url: server.url, path: path + 'me', token: userToken, fields })
     })
 
-    it('Should fail with an invalid noInstanceConfigWarningModal attribute', async function () {
-      const fields = {
-        noInstanceConfigWarningModal: -1
-      }
+    it('Should fail with invalid no modal attributes', async function () {
+      const keys = [
+        'noInstanceConfigWarningModal',
+        'noAccountSetupWarningModal',
+        'noWelcomeModal'
+      ]
 
-      await makePutBodyRequest({ url: server.url, path: path + 'me', token: userToken, fields })
-    })
+      for (const key of keys) {
+        const fields = {
+          [key]: -1
+        }
 
-    it('Should fail with an invalid noWelcomeModal attribute', async function () {
-      const fields = {
-        noWelcomeModal: -1
+        await makePutBodyRequest({ url: server.url, path: path + 'me', token: userToken, fields })
       }
-
-      await makePutBodyRequest({ url: server.url, path: path + 'me', token: userToken, fields })
     })
 
     it('Should succeed to change password with the correct params', async function () {
@@ -517,7 +516,8 @@ describe('Test users API validators', function () {
         email: 'super_email@example.com',
         theme: 'default',
         noInstanceConfigWarningModal: true,
-        noWelcomeModal: true
+        noWelcomeModal: true,
+        noAccountSetupWarningModal: true
       }
 
       await makePutBodyRequest({