Skip to content

test: expand PHP unit test coverage#2912

Merged
Soare-Robert-Daniel merged 5 commits into
developmentfrom
dev/unit-tests
Jul 6, 2026
Merged

test: expand PHP unit test coverage#2912
Soare-Robert-Daniel merged 5 commits into
developmentfrom
dev/unit-tests

Conversation

@Soare-Robert-Daniel

Copy link
Copy Markdown
Contributor

Summary

  • Expands PHPUnit coverage across 7 test files (+1229 lines): icon block custom-SVG sanitization (dangerous attribute values, entity-encoded schemes, non-allowlisted tags, size cap), dashboard (pages-count cache + invalidation hooks, new dashboard data keys, YouTube feed fallback, uninstall feedback popup, form submissions widget), dynamic content, form server, form submissions, patterns registration and patterns upsell.
  • Also includes a small e2e fix: exact match in the heading toolbar test.

Test plan

  • Full suite green locally via wp-env: 469 tests, 1277 assertions, 8 skipped, 0 failures.

🤖 Generated with Claude Code

…mic content, form server/submissions and patterns

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment thread src/blocks/plugins/ai-content/page-style.ts Fixed
Comment thread src/blocks/test/unit/mocks/wordpress-blocks.js Fixed
@pirate-bot

pirate-bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Diff

Package Old Size New Size Diff
Animations 276.77 KB 178.27 KB -98.51 KB (-35.59%)
Blocks 1.55 MB 1.65 MB 102.91 KB (6.49%)
CSS 105.9 KB 7.83 KB -98.06 KB (-92.60%)
Dashboard 204.08 KB 172.49 KB -31.59 KB (-15.48%)
Onboarding 166.59 KB 68.14 KB -98.45 KB (-59.10%)
Export Import 102.86 KB 4.73 KB -98.14 KB (-95.41%)
Pro 412.66 KB 439.82 KB 27.16 KB (6.58%)

@pirate-bot

pirate-bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Plugin build for ac206c4 is ready 🛎️!

…x rendering

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@pirate-bot

pirate-bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

E2E Tests

Playwright Test Status: See serial and parallel matrix jobs

Performance Results serverResponse: {"q25":473.3,"q50":495.95,"q75":506.4,"cnt":10}, firstPaint: {"q25":1340.5,"q50":1371.3,"q75":1493.1,"cnt":10}, domContentLoaded: {"q25":3856.9,"q50":3881.9,"q75":3935.8,"cnt":10}, loaded: {"q25":3858.7,"q50":3883.75,"q75":3938.2,"cnt":10}, firstContentfulPaint: {"q25":4396.7,"q50":4422.45,"q75":4469.1,"cnt":10}, firstBlock: {"q25":15350.4,"q50":15400.05,"q75":15448.6,"cnt":10}, type: {"q25":27.43,"q50":30.28,"q75":30.93,"cnt":10}, typeWithoutInspector: {"q25":24.88,"q50":28.21,"q75":30.52,"cnt":10}, typeWithTopToolbar: {"q25":35.99,"q50":37.96,"q75":38.8,"cnt":10}, typeContainer: {"q25":17.16,"q50":18.57,"q75":20.14,"cnt":10}, focus: {"q25":139.79,"q50":152.96,"q75":163.08,"cnt":10}, inserterOpen: {"q25":45.78,"q50":47.38,"q75":50.25,"cnt":10}, inserterSearch: {"q25":17.36,"q50":19.16,"q75":19.61,"cnt":10}, inserterHover: {"q25":5.91,"q50":6.25,"q75":6.82,"cnt":20}, loadPatterns: {"q25":1929.67,"q50":1952.47,"q75":2017.8,"cnt":10}, listViewOpen: {"q25":269.93,"q50":278.82,"q75":286.45,"cnt":10}

Soare-Robert-Daniel and others added 3 commits July 6, 2026 10:24
…CodeQL sanitization alerts

Regex strip-tags on innerHTML can leave markup fragments behind
(js/incomplete-multi-character-sanitization). Use textContent for DOM
reads and an inert DOMParser document for HTML strings instead.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…bels test

Covers the two remaining CodeQL sanitization alerts (AI page-style
digest, Jest block mock) and the single-quote lint error that failed
the JS Test job.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…pts, add review block tests

- permissions: contents: read on the five CodeQL-flagged workflows (all
  write steps use BOT_TOKEN, unaffected)
- remove test:unit:php:multisite scripts pointing at a nonexistent config
- unit tests for Review_Block ratings math, star markup, JSON-LD schema,
  offers variants, currency fallback and footer schema dedupe

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Soare-Robert-Daniel Soare-Robert-Daniel changed the base branch from master to development July 6, 2026 07:42
@Soare-Robert-Daniel Soare-Robert-Daniel merged commit bb7ac42 into development Jul 6, 2026
17 of 19 checks passed
@Soare-Robert-Daniel Soare-Robert-Daniel deleted the dev/unit-tests branch July 6, 2026 07:53
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.

3 participants