Skip to content

fix: snippet network table lookup and multisite test suite#413

Merged
imantsk merged 16 commits into
core-betafrom
fix/multisite-snippets-and-test-suite
Jun 26, 2026
Merged

fix: snippet network table lookup and multisite test suite#413
imantsk merged 16 commits into
core-betafrom
fix/multisite-snippets-and-test-suite

Conversation

@imantsk

@imantsk imantsk commented Jun 26, 2026

Copy link
Copy Markdown
Member

Summary

Fixes shared/core-rooted bugs surfaced while stabilising the test suite, and hardens the PHPUnit + Playwright suites so they pass in both single-site and multisite environments.

Code fixes

  • snippet-ops: read an inserted snippet back from its own network table so network snippets are no longer looked up in the wrong table (returned id 0 / network=false).
  • REST network scope: resolve an ambiguous network flag fail-closed — any value that is not explicitly falsy is treated as network-scoped, so a forged truthy value can no longer slip past the network-capability check.
  • Manage menu: pass the bulk-download payload into snippet resolution instead of reading the request stream inside the resolver, restoring the network-capability guard and making it unit-testable.
  • Webpack: resolve output and module paths from the repo root so the build emits to src/dist rather than a stray nested directory.

Test suite

  • Enable the subsite snippets menu for multisite unit tests so capability resolution matches a real network install (clears the multisite 403 cascade).
  • Correct the shared-network-snippet read test route.
  • Read the cloud REST test token from the active connection.
  • Derive the Playwright plugin slug from .wp-env.json.
  • Stabilise Playwright: retry config, extended quicknav setup timeout, save-and-confirm retries, and per-spec state cleanup to remove cross-test contamination.
  • Ignore a local .env file.

Testing

  • PHPUnit single-site: 106 passing.
  • PHPUnit multisite (WP_MULTISITE=1): 106 passing.
  • phpcs (WPCS) and eslint: clean on all changed files.
  • npm run build: compiles successfully to src/dist.

imantsk added 13 commits June 26, 2026 18:36
(cherry picked from commit e45500543e2b9719746b96f7be2ccabced5b9a5b)
(cherry picked from commit f4cef532ae309dbfe940e3d87226e115eb6887c0)
(cherry picked from commit 3bf9fb0454298437a1a5b6d03a4fcf3c44f152ea)
(cherry picked from commit 4c3b3c8ecee9562cd178dda3b2df26db8ca6b3e4)
(cherry picked from commit e196a1498c6cebd8e24dc0fd7d2baef044220c28)
(cherry picked from commit c1dd8a1827247ecde8ff902ef84ead6fffb147ba)
(cherry picked from commit eb386aa73fa66f265814dfc78b4130b163fb99ec)
(cherry picked from commit 92e9b9d92cee5900e0f8a3f9d8ede1e7b804230f)
@imantsk imantsk added the run-tests Trigger automated tests label Jun 26, 2026
@imantsk imantsk added the multisite Apply this tag in conjunction with "run-tests" to use a multisite testing environment label Jun 26, 2026
@imantsk imantsk force-pushed the fix/multisite-snippets-and-test-suite branch from 3717e3f to c1db55e Compare June 26, 2026 16:42
@imantsk imantsk merged commit 99b5d55 into core-beta Jun 26, 2026
14 checks passed
@imantsk imantsk deleted the fix/multisite-snippets-and-test-suite branch June 26, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

multisite Apply this tag in conjunction with "run-tests" to use a multisite testing environment run-tests Trigger automated tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant