diff options
author | Chocobozzz <me@florianbigard.com> | 2019-09-24 10:19:55 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-09-24 10:19:55 +0200 |
commit | c1e5bd23d557976ba11f89c53a00c1657a7ea890 (patch) | |
tree | ea6c3808a00122d77237418b125b512f3ad2626e | |
parent | 6aa541481390980f9c85d2e66514ba0e6ce77a35 (diff) | |
download | PeerTube-c1e5bd23d557976ba11f89c53a00c1657a7ea890.tar.gz PeerTube-c1e5bd23d557976ba11f89c53a00c1657a7ea890.tar.zst PeerTube-c1e5bd23d557976ba11f89c53a00c1657a7ea890.zip |
Try to fix tests
-rw-r--r-- | server/middlewares/validators/users.ts | 7 | ||||
-rw-r--r-- | 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' | |||
4 | import { omit } from 'lodash' | 4 | import { omit } from 'lodash' |
5 | import { isIdOrUUIDValid, toBooleanOrNull, toIntOrNull } from '../../helpers/custom-validators/misc' | 5 | import { isIdOrUUIDValid, toBooleanOrNull, toIntOrNull } from '../../helpers/custom-validators/misc' |
6 | import { | 6 | import { |
7 | isNoInstanceConfigWarningModal, isNoWelcomeModal, | 7 | isNoInstanceConfigWarningModal, |
8 | isNoWelcomeModal, | ||
8 | isUserAdminFlagsValid, | 9 | isUserAdminFlagsValid, |
10 | isUserAutoPlayNextVideoValid, | ||
9 | isUserAutoPlayVideoValid, | 11 | isUserAutoPlayVideoValid, |
10 | isUserBlockedReasonValid, | 12 | isUserBlockedReasonValid, |
11 | isUserDescriptionValid, | 13 | isUserDescriptionValid, |
@@ -223,6 +225,9 @@ const usersUpdateMeValidator = [ | |||
223 | body('noWelcomeModal') | 225 | body('noWelcomeModal') |
224 | .optional() | 226 | .optional() |
225 | .custom(v => isNoWelcomeModal(v)).withMessage('Should have a valid noWelcomeModal boolean'), | 227 | .custom(v => isNoWelcomeModal(v)).withMessage('Should have a valid noWelcomeModal boolean'), |
228 | body('autoPlayNextVideo') | ||
229 | .optional() | ||
230 | .custom(v => isUserAutoPlayNextVideoValid(v)).withMessage('Should have a valid autoPlayNextVideo boolean'), | ||
226 | 231 | ||
227 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 232 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
228 | logger.debug('Checking usersUpdateMe parameters', { parameters: omit(req.body, 'password') }) | 233 | 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 () { | |||
128 | 128 | ||
129 | await wait(7000) | 129 | await wait(7000) |
130 | 130 | ||
131 | for (let i = 0; i < 50; i++) { | 131 | for (let i = 0; i < 100; i++) { |
132 | await getVideo(server.url, videoId) | 132 | try { |
133 | await getVideo(server.url, videoId) | ||
134 | } catch { | ||
135 | // don't care if it fails | ||
136 | } | ||
133 | } | 137 | } |
134 | 138 | ||
135 | await getVideo(server.url, videoId, 429) | 139 | await getVideo(server.url, videoId, 429) |