test(supplies): cobertura de tests para desactivación de categorías (#249)#253
Merged
vgpastor merged 2 commits intoJun 30, 2026
Merged
Conversation
…lobalEmergency#249) Añade los tests que cubren los criterios de aceptación de la issue: - update-category.spec.ts (nuevo): archivado y restauración, invariante de categoría núcleo, y preservación de archivedAt cuando no se toca. - list-categories.spec.ts: verifica que la cara pública llama al repo sin includeArchived (filtrado activo) y que la cara admin pasa includeArchived: true. - categories.controller.spec.ts: confirma que archivedAt no aparece en la proyección pública (CategoryDto). - categories-admin.controller.spec.ts: cubre el flujo de archivar vía DELETE y restaurar vía PATCH { archived: false }. La implementación (migración archived_at, filtrado en el repo y los endpoints de gestión) ya estaba completa como parte de GlobalEmergency#221.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
# Conflicts: # apps/api/src/contexts/supplies/application/list-categories.spec.ts
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.
Resumen
La implementación de la issue (columna
archived_atencategories, filtrado enDrizzleCategoryRepository.listCategories()y endpoints admin de archivo/restauración) ya estaba completa como parte de #221.Este PR añade los tests que cubren los criterios de aceptación de #249:
update-category.spec.ts(nuevo): archivado establecearchivedAt, restauración lo limpia anull, categorías núcleo no se pueden archivar,archivedAtexistente se preserva siarchivedno se pasa.list-categories.spec.ts: verifica que la cara pública llama al repo sinincludeArchived(filtro activo por defecto) y que la cara admin pasaincludeArchived: true.categories.controller.spec.ts: confirma quearchivedAtno aparece en la proyección pública (CategoryDto).categories-admin.controller.spec.ts: cubre el flujo completo de archivar víaDELETE /:slugy restaurar víaPATCH /:slug { archived: false }.Validación
pnpm --filter api build— sin errorespnpm --filter api exec eslint ... --max-warnings=0— sin warningspnpm --filter api exec prettier --check ...— formato correctopnpm --filter api test— 1319 tests pasando (208 suites)Cierre
Closes #249