Skip to content

test(e2e): Cover delete sync to Cloudinary - #1367

Open
utkarshcloudinary wants to merge 1 commit into
developfrom
test/delete-sync-e2e
Open

utkarshcloudinary wants to merge 1 commit into
developfrom
test/delete-sync-e2e

Conversation

@utkarshcloudinary

Copy link
Copy Markdown
Collaborator

Adds an e2e spec for delete sync: when a user deletes a synced attachment, the plugin must remove its asset from Cloudinary. No spec covered this before. It is independent of #1366 (new file only, no shared util changes), so it targets develop.

Approach

  • cloudinary-delete-sync.spec.js (@serial) uploads an image and syncs only that attachment through process_assets(), then checks that Sync::is_synced() is true.
  • REST: requestUtils.deleteMedia() deletes the attachment, which is the path the block editor and API clients use.
  • Media Library: the list view row action "Delete permanently" deletes the attachment, which is the path most users take.
  • Each test checks through the Admin API that the asset exists before the delete and is gone after it. Only a 404 counts as "gone". Any other API error fails the test, so a timeout or rate limit cannot look like a successful delete.
  • afterAll removes any asset and attachment that a failed test leaves.

QA notes

  • npm run test:e2e:serial -- cloudinary-delete-sync
  • After the run, the Cloudinary account has no delete-* assets.

Add an e2e spec that deletes a synced attachment through the REST API
and through "Delete permanently" in the Media Library, and checks
through the Admin API that its Cloudinary asset is removed. The spec
syncs only its own attachments, and cleanup removes any asset a failed
test leaves.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants