From c1e5bd23d557976ba11f89c53a00c1657a7ea890 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 24 Sep 2019 10:19:55 +0200 Subject: [PATCH] Try to fix tests --- server/middlewares/validators/users.ts | 7 ++++++- server/tests/api/server/reverse-proxy.ts | 8 ++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/server/middlewares/validators/users.ts b/server/middlewares/validators/users.ts index 871233afe..b3466333c 100644 --- a/server/middlewares/validators/users.ts +++ b/server/middlewares/validators/users.ts @@ -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') }) diff --git a/server/tests/api/server/reverse-proxy.ts b/server/tests/api/server/reverse-proxy.ts index 00d9fca23..39b9fecc0 100644 --- a/server/tests/api/server/reverse-proxy.ts +++ b/server/tests/api/server/reverse-proxy.ts @@ -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)