Utils: Preserve omitted ability input#775
Conversation
|
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 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. |
✅ WordPress Plugin Check Report
📊 ReportAll checks passed! No errors or warnings found. 🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #775 +/- ##
==========================================
Coverage 76.71% 76.71%
Complexity 1828 1828
==========================================
Files 87 87
Lines 7764 7764
==========================================
Hits 5956 5956
Misses 1808 1808
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
We don't currently have any unit tests for our TS files. While I'm not opposed to getting that added, that will require more than just a single test file, we'll need all the underlying code to run those tests as well (and get those set up in CI). May be worth doing that in a separate PR instead of rolling into this one
gziolo
left a comment
There was a problem hiding this comment.
Approved. Verified locally: install, build, tests, lint, and typecheck all pass. Nice, focused fix.
One small follow-up (not blocking): the GET/DELETE path has no test yet, and an explicit null is treated differently there (no input) than in POST (input: null). Worth a quick test and a decision on that case later.
|
Would be great if we can ensure the PR template is followed here. Noticing the |
What?
runAbility()input asundefinedinstead of normalizing it tonull.Why?
Some abilities use an object schema with a default empty object for empty collection/query mode. Passing
nullprevents the abilities client from applying that schema default and can makerunAbility( 'core/users' )fail whereexecuteAbility( 'core/users' )succeeds.Core users is at #774.
Testing