Skip to content

test: add automated PHP, JS, and E2E suites with CI - #53

Merged
firestar300 merged 8 commits into
developfrom
tests
Sep 28, 2026
Merged

firestar300 merged 8 commits into
developfrom
tests

Conversation

@firestar300

@firestar300 firestar300 commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Add wp-env test setup, PHPUnit integration tests, Jest unit tests for tabs behavior, Playwright editor and frontend specs, and GitHub workflows. Extract TabsAutomatic for testability, drop Psalm, and stop versioning composer.lock.


Note

Medium Risk
Editor attribute sync and react-jsx-runtime polyfill affect block registration on older WordPress; KSES change affects saved tab markup. Most risk is in small production PHP/JS fixes alongside large test-only additions.

Overview
Adds automated testing end-to-end: PHPUnit integration tests in an isolated wp-env instance (.wp-env.test.json, port 8889), Jest unit tests for TabsAutomatic and icon-block helpers, and Playwright specs for block insertion in the editor and frontend ARIA/keyboard behavior. Three GitHub Actions workflows run PHP (matrix PHP 8.1/8.3 and WP 6.2 vs latest), JS unit tests, and E2E (with build/Chromium artifact caching).

Tooling changes: Psalm and psalm.xml.dist are removed; PHPUnit and wp-phpunit are added; composer.lock is gitignored; README documents local test commands; ESLint overrides for Jest/Playwright test files.

Runtime/editor fixes bundled with testability work: Frontend TabsAutomatic is extracted to tabs-automatic.js and imported from script.js. useSynchedID and tabsIndex updates move into useEffect/useSelect so attributes are not set during render. Inner blocks use directInsert: false (replacing experimental API). PHP allows aria-controls in KSES and registers a react-jsx-runtime webpack polyfill plus register_react_jsx_runtime() so editor scripts load on WordPress before 6.6.

Reviewed by Cursor Bugbot for commit c954cf1. Bugbot is set up for automated code reviews on this repo. Configure here.

Add wp-env test setup, PHPUnit integration tests, Jest unit tests for
tabs behavior, Playwright editor and frontend specs, and GitHub workflows.
Extract TabsAutomatic for testability, drop Psalm, and stop versioning composer.lock.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread .github/workflows/tests-e2e.yml Outdated

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread .wp-env.test.json

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 304e680. Configure here.

Comment thread blockparty-tabs.php
Ship a react-jsx-runtime polyfill via webpack and assert its registration in PHPUnit. Detect iframed vs legacy editor canvas in Playwright so tabs blocks are found on WP 6.2 and newer cores.
@firestar300
firestar300 merged commit b4da344 into develop Sep 28, 2026
11 checks passed
@firestar300
firestar300 deleted the tests branch September 28, 2026 10:03
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.

2 participants