Skip to content

Build/Test Tools: Run the wp.updates QUnit tests - #14319

Closed
DevinWalker wants to merge 1 commit into
WordPress:trunkfrom
DevinWalker:66324-run-updates-qunit-tests
Closed

DevinWalker wants to merge 1 commit into
WordPress:trunkfrom
DevinWalker:66324-run-updates-qunit-tests

Conversation

@DevinWalker

Copy link
Copy Markdown

The QUnit tests and fixture for wp.updates were added with Shiny Updates in [37714] (WordPress 4.6), but tests/qunit/index.html never loaded them, or updates.js itself, so they have never run.

This PR:

  • Loads tests/qunit/fixtures/updates.js, build/wp-admin/js/updates.js, and tests/qunit/wp-admin/js/updates.js in tests/qunit/index.html.
  • Fills in the update totals in the fixture to match its markup (2 plugin updates). With totals: {}, wp.updates.decrementCount() throws on settings.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

  1. Run npm run grunt qunit:compiled, which is what CI runs.
  2. Before (trunk): 666 assertions pass, and none of them are from wp.updates.
  3. After: 704 of 704 pass on both index.html and the minified compiled.html, including the 38 wp.updates assertions.

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.

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.
@github-actions

Copy link
Copy Markdown

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 dlocc.

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

Copilot AI 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.

🟢 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.

wporg-sync pushed a commit that referenced this pull request Oct 16, 2026
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
@github-actions

Copy link
Copy Markdown

A commit was made that fixes the Trac ticket referenced in the description of this pull request.

SVN changeset: 64410
GitHub commit: 38b0012

This PR will be closed, but please confirm the accuracy of this and reopen if there is more work to be done.

@github-actions github-actions Bot closed this Oct 16, 2026
wporg-sync pushed a commit to WordPress/WordPress that referenced this pull request Oct 16, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants