Files
RenewCMS/features/delete_article_keeps_images.qa.md
T
2026-09-30 18:35:28 +02:00

1.1 KiB

QA procedure: delete_article_keeps_images

Package: test (black-box). Wire useCases.NewDeleteArticleUseCase(articleRepo) (single argument) with the other article use cases and mount as in the retired delete_article_cascades_images.qa.md: Verifier plus Authenticator, RequireCurrentToken, RequireVerifiedUser, jwt cookie for user id 1. Seed images 10 and 11 in mockImageRepo and the article body with their urls. Call validator.InitValidator() first.

HTTP checks

  1. DELETE /v1/article/1 with a valid cookie -> 204, articleRepo no longer holds article 1, imageRepo.images still holds 10 and 11 and deleteCalls is empty.
  2. DELETE /v1/article/9999 -> 404, body "Article not found\n", image repo untouched.
  3. DELETE /v1/article/1 without cookie -> 401, article and images still present.
  4. Article fake's Delete armed to fail -> 500, body "Failed to delete article\n", image repo untouched.

Manual verification

With a real SQLite file and UPLOAD_DIR, delete an article and confirm the image files and rows remain and still load. No SMTP.