1.4 KiB
I've created all the unit tests for the 5 requested cases. Here's a summary:
Backend Tests (Laravel/PHPUnit)
-
back/tests/Feature/ProcesoAdmisionPublicadosTest.php • Tests that /api/procesos-admision/publicados returns only processes with publicado=true • Verifies empty array returned when no published processes exist • Confirms ordering by id descending
-
back/tests/Feature/ProcesoAdmisionUpdateNullableTest.php • Tests that update method sets nullable fields to null when empty values are provided • Covers date fields, link fields, and text fields • Verifies fields not in request remain unchanged
Frontend Tests (Vitest)
-
front/tests/store/procesosAdmisionStore.test.js • Tests fetchProcesosPublicados action fetches and updates state • Covers loading states, error handling, and API endpoint verification
-
front/tests/components/ConvocatoriasSection.test.js • Tests rendering of main card for first process and secondary cards for remaining • Verifies estado label mapping, action button events, and empty state
-
front/tests/components/WebPage.test.js • Tests showModal function displays correct detalle information • Covers all tipo cases (requisitos, pagos, vacantes, cronograma) • Handles edge cases: missing proceso, empty detalles, null values
To Run Tests
Backend: cd back && php artisan test bash Frontend (after installing dependencies): cd front && npm install && npm test bash