Try to fix tests
authorChocobozzz <me@florianbigard.com>
Tue, 24 Sep 2019 08:19:55 +0000 (10:19 +0200)
committerChocobozzz <me@florianbigard.com>
Tue, 24 Sep 2019 08:19:55 +0000 (10:19 +0200)
server/middlewares/validators/users.ts
server/tests/api/server/reverse-proxy.ts

index 871233afe52d35dd2c9d550a5a38caf696cf00b6..b3466333caa9bf645dc4b6506ce216e685cabefb 100644 (file)
@@ -4,8 +4,10 @@ import { body, param } from 'express-validator'
 import { omit } from 'lodash'
 import { isIdOrUUIDValid, toBooleanOrNull, toIntOrNull } from '../../helpers/custom-validators/misc'
 import {
-  isNoInstanceConfigWarningModal, isNoWelcomeModal,
+  isNoInstanceConfigWarningModal,
+  isNoWelcomeModal,
   isUserAdminFlagsValid,
+  isUserAutoPlayNextVideoValid,
   isUserAutoPlayVideoValid,
   isUserBlockedReasonValid,
   isUserDescriptionValid,
@@ -223,6 +225,9 @@ const usersUpdateMeValidator = [
   body('noWelcomeModal')
     .optional()
     .custom(v => isNoWelcomeModal(v)).withMessage('Should have a valid noWelcomeModal boolean'),
+  body('autoPlayNextVideo')
+    .optional()
+    .custom(v => isUserAutoPlayNextVideoValid(v)).withMessage('Should have a valid autoPlayNextVideo boolean'),
 
   async (req: express.Request, res: express.Response, next: express.NextFunction) => {
     logger.debug('Checking usersUpdateMe parameters', { parameters: omit(req.body, 'password') })
index 00d9fca230faf132c329f055824181fdcc9b11af..39b9fecc08e2e7e0e218e36166e732cd0af8a8d6 100644 (file)
@@ -128,8 +128,12 @@ describe('Test application behind a reverse proxy', function () {
 
     await wait(7000)
 
-    for (let i = 0; i < 50; i++) {
-      await getVideo(server.url, videoId)
+    for (let i = 0; i < 100; i++) {
+      try {
+        await getVideo(server.url, videoId)
+      } catch {
+        // don't care if it fails
+      }
     }
 
     await getVideo(server.url, videoId, 429)