Skip to content

Commit 38b0012

Browse files
committed
Build/Test Tools: Run the wp.updates QUnit tests.
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
1 parent 8c61b98 commit 38b0012

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

‎tests/qunit/fixtures/updates.js‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,15 @@ window._wpUpdatesSettings = {
5959
};
6060
window._wpUpdatesItemCounts = {
6161
plugins: {},
62-
totals: {}
62+
// Matches the update counts in the fixture markup in index.html.
63+
totals: {
64+
counts: {
65+
plugins: 2,
66+
themes: 0,
67+
wordpress: 0,
68+
translations: 0,
69+
total: 2
70+
},
71+
title: '2 Plugin Updates'
72+
}
6373
};

‎tests/qunit/index.html‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
<script src="fixtures/js-widgets-endpoint.js"></script>
8686
<script src="fixtures/wp-api.js"></script>
8787
<script src="fixtures/common.js"></script>
88+
<script src="fixtures/updates.js"></script>
8889
</div>
8990

9091
<!-- Tested files -->
@@ -98,6 +99,7 @@
9899
<script src="../../build/wp-includes/js/customize-models.js"></script>
99100
<script src="../../build/wp-includes/js/shortcode.js"></script>
100101
<script src="../../build/wp-includes/js/wp-sanitize.js"></script>
102+
<script src="../../build/wp-admin/js/updates.js"></script>
101103
<script>
102104
/*
103105
* wp-emoji reads these when it is loaded, and waits for the Twemoji library before doing
@@ -183,6 +185,7 @@
183185
<script src="wp-admin/js/customize-base.js"></script>
184186
<script src="wp-admin/js/customize-header.js"></script>
185187
<script src="wp-admin/js/dashboard.js"></script>
188+
<script src="wp-admin/js/updates.js"></script>
186189
<script src="wp-includes/js/shortcode.js"></script>
187190
<script src="wp-includes/js/media/test-media-models.js"></script>
188191
<script src="wp-includes/js/api-request.js"></script>

0 commit comments

Comments
 (0)