1.1 KiB
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
DELETE /v1/article/1with a valid cookie -> 204,articleRepono longer holds article 1,imageRepo.imagesstill holds 10 and 11 anddeleteCallsis empty.DELETE /v1/article/9999-> 404, body"Article not found\n", image repo untouched.DELETE /v1/article/1without cookie -> 401, article and images still present.- Article fake's
Deletearmed 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.