Repository navigation
Build/Test Tools: Run the wp.updates QUnit tests - #14319
DevinWalker wants to merge 1 commit into
Conversation
The QUnit tests and fixture for `wp.updates` were added in [37714], but `tests/qunit/index.html` never loaded them, or `updates.js` itself, so they have never run. This loads the fixture, `updates.js`, and its tests, and fills in the update totals in the fixture so `decrementCount()` has counts to work with. Without them, `decrementCount()` throws. See #66324.
|
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 Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
There was a problem hiding this comment.
🟢 Approval recommended
The focused runner and fixture changes are consistent with the existing tests, with no blocking issues identified.
0 open findings
What changed in this PR
Enables the existing wp.updates QUnit suite so it runs before the planned test-framework migration.
Changes:
- Loads the updates fixture, implementation, and tests in the QUnit runner.
- Supplies fixture totals matching the two plugin updates, preventing count-related errors.
| File | Description |
|---|---|
| tests/qunit/index.html | Loads the scripts needed to run the updates tests. |
| tests/qunit/fixtures/updates.js | Initializes update totals to match the fixture markup. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Load the existing updates fixture, implementation, and tests in the QUnit runner so their assertions run against both development and minified scripts. Populate the fixture's update totals to match its markup and prevent `wp.updates.decrementCount()` from throwing when it accesses the counts. Developed in: #14319 Props dlocc. Fixes #66324. git-svn-id: https://develop.svn.wordpress.org/trunk@64410 602fd350-edb4-49c9-b593-d223f7449a82
Load the existing updates fixture, implementation, and tests in the QUnit runner so their assertions run against both development and minified scripts. Populate the fixture's update totals to match its markup and prevent `wp.updates.decrementCount()` from throwing when it accesses the counts. Developed in: WordPress/wordpress-develop#14319 Props dlocc. Fixes #66324. Built from https://develop.svn.wordpress.org/trunk@64410 git-svn-id: http://core.svn.wordpress.org/trunk@63560 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The QUnit tests and fixture for
wp.updateswere added with Shiny Updates in [37714] (WordPress 4.6), buttests/qunit/index.htmlnever loaded them, orupdates.jsitself, so they have never run.This PR:
tests/qunit/fixtures/updates.js,build/wp-admin/js/updates.js, andtests/qunit/wp-admin/js/updates.jsintests/qunit/index.html.totals: {},wp.updates.decrementCount()throws onsettings.totals.counts. Because that error escapes the test, QUnit also reports it as a "Script error." on an unrelated wpapi test.#59644 plans to move these tests off QUnit. Getting them running first means they come along when that happens.
Trac ticket: https://core.trac.wordpress.org/ticket/66324
Testing Instructions
npm run grunt qunit:compiled, which is what CI runs.wp.updates.index.htmland the minifiedcompiled.html, including the 38wp.updatesassertions.Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Finding that the suite never ran, writing the patch, and running the QUnit suite before and after. I reviewed the code and the test results before submitting.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.