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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Font Library: Add upload font test #60221
Font Library: Add upload font test #60221
Changes from 16 commits
6c3c85d
612c540
14c419c
c9b8a1e
7546a06
5677dbe
5089b36
ca4606b
dd90c38
be75bfa
8b58239
c89457c
cd9d86c
43f96b4
f38f4f6
871d17c
b81f7b7
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In some development environments the content and uploads folder is shared between the test suite and the developer's manual testing so deleting the directory will fail as it will contain files.
If the files are deleted beforehand then the manual testing environment will be busted.
For the test suite I suggest filtering the folder and cleaning it up afterwards. You can probably use
wp_generate_uuid4()
to generate the folder name.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, that part is brittle. I've modified the plugin to use a randomly generated directory for fonts during the duration of the test and to cleanup on plugin activation and deactivation. Let me know what you think!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Grant, that looks good. Is there an e2e tear down at the end that could be used to delete the temporary folder? It's no big deal if there isn't.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that because of the way we're testing here with a plugin to handle the server-side logic, the tear-down happens on deactivation on the plugin, i.e. on line 19 we deactivate the plugin after all tests:
And the plugin handles the deletion of fonts and folders on deactivation: