feat(tests): Jest backend (38 tests), Jest RTL frontend (28 tests), Playwright E2E spec
This commit is contained in:
@@ -5,7 +5,7 @@ const auditMiddleware = require('../middleware/auditMiddleware');
|
||||
const { validateRequest } = require('../middleware/errorHandler');
|
||||
|
||||
const animalValidation = [
|
||||
body('experiment_id').notEmpty().withMessage('experiment_id is required').isUUID().withMessage('experiment_id must be a valid UUID'),
|
||||
body('experiment_id').notEmpty().withMessage('experiment_id is required').matches(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i).withMessage('experiment_id must be a valid UUID'),
|
||||
body('animal_id_string').trim().notEmpty().withMessage('animal_id_string is required'),
|
||||
body('animal_name').trim().notEmpty().withMessage('animal_name is required'),
|
||||
];
|
||||
@@ -18,7 +18,7 @@ const animalUpdateValidation = [
|
||||
// GET /api/animals?experimentId=<uuid> — list for experiment
|
||||
router.get(
|
||||
'/',
|
||||
[query('experimentId').optional().isUUID().withMessage('experimentId must be a valid UUID')],
|
||||
[query('experimentId').optional().matches(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i).withMessage('experimentId must be a valid UUID')],
|
||||
validateRequest,
|
||||
async (req, res, next) => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user