Skip to content

Make the test suites site-independent and cover parent dragging - #159

Merged
puikinsh merged 7 commits into
masterfrom
test/fixture-independence
Nov 26, 2026
Merged

puikinsh merged 7 commits into
masterfrom
test/fixture-independence

Conversation

@puikinsh

Copy link
Copy Markdown
Member

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:

  • 22 regression checks: refused while off (setting or scpo_allow_reparent); 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 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.
  • 24 Chrome e2e checks: off by default; Right/Left Arrow nest, announce and keep Quick Edit in step; Escape saves nothing; plain vertical drags never re-parent; a 70 px sideways drag nests; parents take their children; a refused parent offers Reload, clears the unsaved-changes guard and is never resent; categories.

Where the full suites now pass (regression / transactions / compatibility / HTTP / Chrome e2e):

Environment Result
WP 7.2 RC3, PHP 8.5, MariaDB 11 103 / 11 / 35 / 34 / 87
+ Redis persistent object cache + WooCommerce (SCPO_TEST_WOO=1) 106 / 11 / 35 / 34 / 96
WP 7.2 RC3, PHP 8.5, MySQL 8.4 103 / 11 / 35 / 34 / 87
WP 7.2 RC3, PHP 8.6, MariaDB 11 (no PHP notices) 103 / 11 / 35 / 34 / 87
WP 6.2.6, PHP 7.4 (minimum supported) 103 / 11 / 35 / 34 / 87
WP 7.2 multisite subsite, super admin and site admin 103 / 11 / 35 / 34 / 87

🤖 Generated with Claude Code

puikinsh and others added 7 commits November 26, 2026 17:37
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>
@puikinsh
puikinsh merged commit 21d13b5 into master Nov 26, 2026
8 checks passed
@puikinsh
puikinsh deleted the test/fixture-independence branch November 26, 2026 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant