Repository navigation
test(e2e): Cover the media storage modes - #1366
Open
utkarshcloudinary wants to merge 1 commit into
Open
utkarshcloudinary wants to merge 1 commit into
utkarshcloudinary wants to merge 1 commit into
Conversation
Add an e2e spec for the three storage settings. It checks that "Cloudinary only" keeps the local files during the delete delay and removes them after it, that "Cloudinary and WordPress" downloads the full-quality files again, and that the low resolution mode keeps a smaller local copy. In each mode the image must still load from Cloudinary. Cleanup removes the Cloudinary assets through the API. Deleting an attachment removes its asset only when the plugin thinks it is synced, and after a storage change it is not.
This branch has not been deployed
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.
Adds an e2e spec for the three storage settings: "Cloudinary only", "Cloudinary and WordPress" and "Cloudinary and WordPress (low resolution)". No spec covered them before, and a bug here can remove the only local copy of a file.
Approach
cloudinary-storage-modes.spec.js(@serial) pins lazy load off and auto sync on, setsoffloadfor each test, and restores the settings inafterAll.Storage::DELETE_DELAY, syncs again, and checks that the main file and every size file are removed and_cloudinary_storageiscld. The image must still load from Cloudinary.process_assets(), notwp cloudinary sync. A storage change replaces or removes the local files of every synced attachment, so a library-wide sync changes media that other specs or developers left in the test site.afterAllremoves the Cloudinary assets through the API before it deletes the attachments. Delete sync removes an asset only whenSync::is_synced()is true, and after a storage change it is not, so the assets stayed in the account.QA notes
npm run test:e2e:serial -- cloudinary-storage-modesstorage-*assets, andcloudinary_sync_media.offloadis back to its value before the run.