Try to fix tests

pull/2158/head
Chocobozzz 2019-09-24 10:19:55 +02:00
parent 6aa5414813
commit c1e5bd23d5
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 12 additions and 3 deletions

View 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') })

View 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)