-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_validation.js
More file actions
37 lines (30 loc) · 1013 Bytes
/
Copy pathtest_validation.js
File metadata and controls
37 lines (30 loc) · 1013 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Quick test to verify validation schemas work correctly
import {
validateBazaarApplication,
validateBoothApplication,
} from "./server/src/features/applications/application.validation.js";
import { logger } from "./server/src/utils/logger.js";
logger.info("Testing validation schemas...");
// Test bazaar validation
const bazaarData = {
attendees: [{ name: "John Doe", email: "john@example.com" }],
boothSize: "2x2",
};
const bazaarResult = validateBazaarApplication.validate(bazaarData);
logger.info(
"Bazaar validation result:",
bazaarResult.error ? bazaarResult.error.message : "Valid"
);
// Test booth validation
const boothData = {
attendees: [{ name: "Jane Doe", email: "jane@example.com" }],
boothSize: "4x4",
durationWeeks: 2,
locationPreference: "Main Hall",
};
const boothResult = validateBoothApplication.validate(boothData);
logger.info(
"Booth validation result:",
boothResult.error ? boothResult.error.message : "Valid"
);
logger.info("Validation test completed!");