Add comprehensive unit tests for Security, UserModel, and Validation utilities

- Implemented SecurityTest to validate token generation, CSRF protection, input sanitization, and rate limiting.
- Created UserModelTest to ensure correct database operations for user management, including creation, updating, banning, and fetching active users.
- Developed ValidationTest to verify input validation and sanitization for user IDs, nicknames, messages, and API requests.
- Introduced Security and Validation utility classes with methods for secure token generation, input sanitization, and comprehensive validation rules.
This commit is contained in:
Vincent 2025-09-30 21:22:28 -04:00
parent 5692874b10
commit 41cd7a4fd8
32 changed files with 5796 additions and 368 deletions

View file

@ -144,115 +144,6 @@
grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
}
/* =================================================================
RESPONSIVE WIDTH/HEIGHT UTILITIES - Using Breakpoint Custom Properties
================================================================= */
/* Responsive Width - Small and up */
@media (min-width: var(--breakpoint-sm)) {
.sm\:w-full { width: 100%; }
.sm\:w-auto { width: auto; }
.sm\:w-1\/2 { width: 50%; }
.sm\:w-1\/3 { width: 33.333333%; }
.sm\:w-2\/3 { width: 66.666667%; }
.sm\:w-1\/4 { width: 25%; }
.sm\:w-3\/4 { width: 75%; }
}
/* Responsive Width - Medium and up */
@media (min-width: var(--breakpoint-md)) {
.md\:w-full { width: 100%; }
.md\:w-auto { width: auto; }
.md\:w-1\/2 { width: 50%; }
.md\:w-1\/3 { width: 33.333333%; }
.md\:w-2\/3 { width: 66.666667%; }
.md\:w-1\/4 { width: 25%; }
.md\:w-3\/4 { width: 75%; }
}
/* Responsive Width - Large and up */
@media (min-width: var(--breakpoint-lg)) {
.lg\:w-full { width: 100%; }
.lg\:w-auto { width: auto; }
.lg\:w-1\/2 { width: 50%; }
.lg\:w-1\/3 { width: 33.333333%; }
.lg\:w-2\/3 { width: 66.666667%; }
.lg\:w-1\/4 { width: 25%; }
.lg\:w-3\/4 { width: 75%; }
}
/* Responsive Width - Extra Large and up */
@media (min-width: var(--breakpoint-xl)) {
.xl\:w-full { width: 100%; }
.xl\:w-auto { width: auto; }
.xl\:w-1\/2 { width: 50%; }
.xl\:w-1\/3 { width: 33.333333%; }
.xl\:w-2\/3 { width: 66.666667%; }
.xl\:w-1\/4 { width: 25%; }
.xl\:w-3\/4 { width: 75%; }
}
/* Responsive Width - 2XL and up */
@media (min-width: var(--breakpoint-2xl)) {
.2xl\:w-full { width: 100%; }
.2xl\:w-auto { width: auto; }
.2xl\:w-1\/2 { width: 50%; }
.2xl\:w-1\/3 { width: 33.333333%; }
.2xl\:w-2\/3 { width: 66.666667%; }
.2xl\:w-1\/4 { width: 25%; }
.2xl\:w-3\/4 { width: 75%; }
}
/* Responsive Height - Small and up */
@media (min-width: var(--breakpoint-sm)) {
.sm\:h-full { height: 100%; }
.sm\:h-auto { height: auto; }
.sm\:h-screen { height: 100vh; }
.sm\:h-1\/2 { height: 50%; }
.sm\:h-1\/3 { height: 33.333333%; }
.sm\:h-2\/3 { height: 66.666667%; }
}
/* Responsive Height - Medium and up */
@media (min-width: var(--breakpoint-md)) {
.md\:h-full { height: 100%; }
.md\:h-auto { height: auto; }
.md\:h-screen { height: 100vh; }
.md\:h-1\/2 { height: 50%; }
.md\:h-1\/3 { height: 33.333333%; }
.md\:h-2\/3 { height: 66.666667%; }
}
/* Responsive Height - Large and up */
@media (min-width: var(--breakpoint-lg)) {
.lg\:h-full { height: 100%; }
.lg\:h-auto { height: auto; }
.lg\:h-screen { height: 100vh; }
.lg\:h-1\/2 { height: 50%; }
.lg\:h-1\/3 { height: 33.333333%; }
.lg\:h-2\/3 { height: 66.666667%; }
}
/* Responsive Height - Extra Large and up */
@media (min-width: var(--breakpoint-xl)) {
.xl\:h-full { height: 100%; }
.xl\:h-auto { height: auto; }
.xl\:h-screen { height: 100vh; }
.xl\:h-1\/2 { height: 50%; }
.xl\:h-1\/3 { height: 33.333333%; }
.xl\:h-2\/3 { height: 66.666667%; }
}
/* Responsive Height - 2XL and up */
@media (min-width: var(--breakpoint-2xl)) {
.2xl\:h-full { height: 100%; }
.2xl\:h-auto { height: auto; }
.2xl\:h-screen { height: 100vh; }
.2xl\:h-1\/2 { height: 50%; }
.2xl\:h-1\/3 { height: 33.333333%; }
.2xl\:h-2\/3 { height: 66.666667%; }
}
/* =================================================================
RESPONSIVE GRID VARIATION CLASSES - Extra Large breakpoint (xl and up)
================================================================= */
@ -555,6 +446,7 @@
.h-1\/4 { height: 25%; }
.h-2\/4 { height: 50%; }
.h-3\/4 { height: 75%; }
/* =================================================================
RESPONSIVE WIDTH/HEIGHT UTILITIES - Using Breakpoint Custom Properties
================================================================= */