- Timestamp:
- 02/24/2017 06:39:39 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/theme.js
r40107 r40109 1929 1929 self.view.collection.once( 'query:success', function() { 1930 1930 $( 'div[data-slug="' + slug + '"]' ).trigger( 'click' ); 1931 }) 1931 }); 1932 1932 1933 1933 } -
trunk/tests/qunit/fixtures/wp-api.js
r40058 r40109 1 /* global mockedApiResponse, Backbone */1 /* global mockedApiResponse, Backbone, jsWidgetsEndpointSchema */ 2 2 /** 3 3 * @var mockedApiResponse defined in wp-api-generated.js … … 24 24 'wp-json/wp/v2/taxonomy': mockedApiResponse.TaxonomyModel, 25 25 'wp-json/wp/v2/status': mockedApiResponse.StatusModel, 26 'wp-json/wp/v2/type': mockedApiResponse.TypeModel 26 'wp-json/wp/v2/type': mockedApiResponse.TypeModel, 27 'wp-json/js-widgets/v1/': jsWidgetsEndpointSchema 27 28 }; 28 29 -
trunk/tests/qunit/index.html
r40058 r40109 41 41 <script src="fixtures/customize-widgets.js"></script> 42 42 <script src="fixtures/wp-api-generated.js"></script> 43 <script src="fixtures/js-widgets-endpoint.js"></script> 43 44 <script src="fixtures/wp-api.js"></script> 44 45 </div> -
trunk/tests/qunit/wp-admin/js/nav-menu.js
r39928 r40109 8 8 // Fail if we don't see the expected number of events triggered in 1500 ms. 9 9 setTimeout( function() { 10 assert.equal( 10 // QUnit may load this file without running it, in which case `assert` 11 // will never be set to `assertPassed` below. 12 assert && assert.equal( 11 13 eventsFired, 12 14 eventsExpected, -
trunk/tests/qunit/wp-includes/js/wp-api.js
r40058 r40109 193 193 } ); 194 194 195 // Test the jswidget custom namespace and endpoints. 196 wp.api.init( { 197 'versionString': 'js-widgets/v1/' 198 } ).done( function() { 199 var customClasses = [ 200 'WidgetsArchives', 201 'WidgetsCalendar', 202 'WidgetsCategories', 203 'WidgetsMeta', 204 'WidgetsNav_menu', 205 'WidgetsPages', 206 'WidgetsPostCollection', 207 'WidgetsRecentComments', 208 'WidgetsRecentPosts', 209 'WidgetsRss', 210 'WidgetsSearch', 211 'WidgetsTag_cloud', 212 'WidgetsText' 213 ]; 214 215 // Check that we have and can get each model type. 216 _.each( customClasses, function( className ) { 217 QUnit.test( 'Checking ' + className + ' class name.' , function( assert ) { 218 var done = assert.async(); 219 220 assert.expect( 2 ); 221 222 wp.api.loadPromise.done( function() { 223 var theModel = new wp.api.models[ className ](); 224 assert.ok( theModel, 'We can instantiate wp.api.models.' + className ); 225 var theCollection = new wp.api.collections[ className ](); 226 assert.ok( theCollection, 'We can instantiate wp.api.collections.' + className ); 227 // Trigger Qunit async completion. 228 done(); 229 } ); 230 } ); 231 } ); 232 233 } ); 234 195 235 } )( window.QUnit );
Note: See TracChangeset
for help on using the changeset viewer.