-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Fix misleading test description for 0 bytes filesize handling #74016
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
Conversation
Co-authored-by: ramonjd <[email protected]>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @Copilot. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Co-authored-by: ramonjd <[email protected]> Co-authored-by: copilot-swe-agent[bot] <[email protected]>
The test for
getValue()returning an empty string when filesize is 0 incorrectly attributed this behavior toisVisiblehiding the value. The actual cause is the truthy check ingetValue()itself.Root cause
The
getValueimplementation uses a truthy check:When
filesizeis0, the truthy check treats it as falsy and returns an empty string beforeformatFileSize()is ever called. TheformatFileSize()function itself would return"0 B"if it received 0.Changes
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.