Skip to content

Conversation

@priethor
Copy link
Contributor

@priethor priethor commented Jan 2, 2026

What

Part of #315.

Adds Jest unit tests for the core JavaScript Model and Field class system.

Why

These classes are foundational to the JavaScript architecture.

How

Adding 233 tests across 9 test files:

File Class Tested Tests
model.test.js acf.Model 47
field.test.js acf.Field 55
fields.test.js Fields manager 25
fields/select.test.js Select field 24
fields/radio.test.js Radio field 22
fields/true-false.test.js True/False field 19
fields/range.test.js Range field 13
fields/button-group.test.js Button Group field 16
fields/url.test.js URL field 20

Testing Instructions

Run the test suite:

npm run test:unit

@github-actions
Copy link

github-actions bot commented Jan 2, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props priethor.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@priethor priethor mentioned this pull request Jan 2, 2026
22 tasks
@codecov
Copy link

codecov bot commented Jan 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 30.90%. Comparing base (7551a70) to head (72d1627).
⚠️ Report is 3 commits behind head on trunk.

Additional details and impacted files
@@             Coverage Diff              @@
##              trunk     #340      +/-   ##
============================================
+ Coverage     30.63%   30.90%   +0.26%     
  Complexity     4410     4410              
============================================
  Files           291      291              
  Lines         36918    36918              
============================================
+ Hits          11310    11408      +98     
+ Misses        25608    25510      -98     
Flag Coverage Δ
e2e 42.91% <ø> (-0.51%) ⬇️
javascript 10.66% <ø> (+4.12%) ⬆️
phpunit 28.70% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@priethor priethor self-assigned this Jan 2, 2026
@priethor priethor added this to the 6.9.0 milestone Jan 2, 2026
@priethor priethor merged commit 5da9dbc into trunk Jan 2, 2026
10 checks passed
@priethor priethor deleted the 0be8-phase-3-pr-15-co branch January 2, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants