Feature/dc no ref jest#64
Merged
Merged
Conversation
DanielQueijeiro
requested changes
May 11, 2025
| * de ListaUsuarios con objetos Usuario correctamente construidos. | ||
| */ | ||
| it('devuelve ListaUsuarios con objetos Usuario (camino feliz)', async () => { | ||
| const respuestaMock = { |
Collaborator
There was a problem hiding this comment.
respuestaMock debería ser respuestaPrueba o algo en español
| { id: 2, nombre: 'Ana', correo: 'ana@example.com' } | ||
| ] | ||
| }; | ||
| obtenerUsuariosAPIMock.mockResolvedValue(respuestaMock); |
Collaborator
There was a problem hiding this comment.
cambiar obtenerUsuariosAPIMock
| * Se espera una ListaUsuarios vacía. | ||
| */ | ||
| it('devuelve ListaUsuarios vacía si la API no trae usuarios', async () => { | ||
| obtenerUsuariosAPIMock.mockResolvedValue({ ok: true, usuarios: [] }); |
| * El caso de uso debe lanzar una excepción con mensaje descriptivo. | ||
| */ | ||
| it('lanza error cuando la API responde ok = false', async () => { | ||
| obtenerUsuariosAPIMock.mockResolvedValue({ ok: false }); |
| * El caso de uso debe capturar el error y lanzar una excepción clara. | ||
| */ | ||
| it('lanza error cuando la API rechaza la promesa', async () => { | ||
| obtenerUsuariosAPIMock.mockRejectedValue(new Error('Network error')); |
jotapeeeeee
reviewed
May 11, 2025
jotapeeeeee
reviewed
May 11, 2025
jotapeeeeee
reviewed
May 11, 2025
jotapeeeeee
reviewed
May 11, 2025
jotapeeeeee
approved these changes
May 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Solicitud de cambio (PR)
Agregar pruebas automatizadas con jest
Descripción detallada
Se agregaron pruebas automatizadas con jest y se diseñaron pruebas para la RF40 Consultar Usuarios
Tipo de cambio
Checklist del autor:
Checklist del evaluador: