Repository navigation
Make the test suites site-independent and cover parent dragging - #159
Merged
Merged
Conversation
It hard-coded localhost plus a socket, so on any site whose DB_HOST is host:port the four independent-session race checks threw before running. It now parses DB_HOST the way wpdb does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
They assumed the original dev site: more than 100 pages, at least 20 pages, a first category that already had children, and an already-normalised page tree. On any other site they failed without a plugin fault. Each now derives its expectation from the site it runs on (and the category test seeds the sibling it needs). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
22 checks for drag-to-reparent: refused while the setting or the scpo_allow_reparent filter is off; nesting and un-nesting through wp_update_post (save hooks fire once); refusals for another post type, a missing, trashed or self parent, loops, rows outside the submitted order, non-hierarchical types and taxonomies, stale lists and authors who cannot edit pages; editors allowed; sibling slugs kept unique; the same rules for categories. Each refusal asserts its reason, not just a failure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
24 checks in a real browser: off by default; Right/Left Arrow nest and un-nest, announce it and keep Quick Edit's parent in step; Escape saves nothing; plain vertical drags never re-parent; a 70px sideways drag nests; parents take their children along; a refused parent offers Reload, clears the unsaved-changes guard and is never resent; categories nest and un-nest. The site's pages, categories and settings are restored afterwards. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With tied menu_order values every order is consistent with the stored data, so on a freshly seeded site the snapshot could not be stale and the save rightly succeeded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
WordPress before 6.5 escapes slashes in localized data, so the root-relative ajax_url check now accepts both forms. Core's own unload listeners (6.2's Heartbeat, TinyMCE) are no longer counted as our JS errors. The parent-drag checks nest under published pages, because core's Quick Edit cannot show a draft parent (WooCommerce creates one). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The root-relative ajax_url checks now accept a subdirectory multisite prefix (/sub/wp-admin/...) while still rejecting absolute URLs. The parent-drag family check seeds its own two child pages instead of depending on where earlier sections left the page tree. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Test-only changes; nothing in the plugin package changes.
Fixture independence. Six checks assumed the original dev site (100+ pages, 20+ pages, a first category with children, an already-normalised page tree, a localhost DB socket, a root install, a published page above every page). Each now derives its expectation from the site it runs on, or seeds what it needs. Before this, a fresh site showed 5–8 failures with no plugin fault.
Parent dragging (2.9.0) coverage. It had none in the repo:
scpo_allow_reparent); nesting and un-nesting throughwp_update_post(save hooks fire once); refusals for another post type, a missing, trashed or self parent, loops, rows outside the order, non-hierarchical types and taxonomies, stale lists and authors; editors allowed; sibling slugs kept unique; the same rules for categories. Every refusal asserts its reason.Where the full suites now pass (regression / transactions / compatibility / HTTP / Chrome e2e):
SCPO_TEST_WOO=1)🤖 Generated with Claude Code