You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.4 KiB
Markdown
37 lines
1.4 KiB
Markdown
I've created all the unit tests for the 5 requested cases. Here's a summary:
|
|
|
|
Backend Tests (Laravel/PHPUnit)
|
|
|
|
1. 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
|
|
|
|
2. 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)
|
|
|
|
3. front/tests/store/procesosAdmisionStore.test.js
|
|
• Tests fetchProcesosPublicados action fetches and updates state
|
|
• Covers loading states, error handling, and API endpoint verification
|
|
|
|
4. 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
|
|
|
|
5. 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 |