Skip to content

Commit a0b6749

Browse files
committed
Customize: Fix QUnit tests after failures introduced in [41768].
Props bpayton. Fixes #40104. git-svn-id: https://develop.svn.wordpress.org/trunk@41773 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 6e25b4b commit a0b6749

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

tests/qunit/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,19 @@ <h3 class="accordion-section-title" tabindex="0">
371371
<button type="button" class="menus-move-up">Move up</button><button type="button" class="menus-move-down">Move down</button><button type="button" class="menus-move-left">Move one level up</button><button type="button" class="menus-move-right">Move one level down</button> </div>
372372
</script>
373373

374+
<script type="text/html" id="tmpl-nav-menu-locations-header">
375+
<span class="customize-control-title customize-section-title-menu_locations-heading"><?php _e( 'Menu Locations' ); ?></span>
376+
<p class="customize-control-description customize-section-title-menu_locations-description">Something</p>
377+
</script>
378+
379+
<script type="text/html" id="tmpl-nav-menu-create-menu-section-title">
380+
<h3>
381+
<button type="button" class="button customize-add-menu-button">
382+
<?php _e( 'Create New Menu' ); ?>
383+
</button>
384+
</h3>
385+
</script>
386+
374387
<script type="text/html" id="tmpl-customize-section-sidebar">
375388
<li id="accordion-section-{{ data.id }}" class="accordion-section control-section control-section-{{ data.type }}">
376389
<h3 class="accordion-section-title" tabindex="0">

tests/qunit/wp-admin/js/customize-nav-menus.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jQuery( window ).load( function (){
5353
// @todo Add more tests for api.Menus.MenusPanel behaviors
5454

5555
test( 'there an expected MenuSection for the primary menu', function() {
56-
var section, controls;
56+
var section, controls, lastControl;
5757

5858
section = api.section( 'nav_menu[' + primaryMenuId + ']' );
5959
ok( section, 'section exists' );
@@ -65,7 +65,10 @@ jQuery( window ).load( function (){
6565
controls = section.controls();
6666
ok( controls[0].extended( api.Menus.MenuNameControl ), 'first control in menu section is MenuNameControl' );
6767
ok( controls[1].extended( api.Menus.MenuItemControl ), 'second control in menu section is MenuItemControl' );
68-
ok( controls[ controls.length - 1 ].extended( api.Menus.MenuDeleteControl ), 'last control in menu section is a MenuDeleteControl' );
68+
69+
lastControl = controls[ controls.length - 1 ];
70+
ok( lastControl.extended( api.Control ), 'last control in menu section is a base Control' );
71+
ok( lastControl.params.templateId === 'nav-menu-delete-button', 'last control in menu section has a delete-button template' );
6972
} );
7073
// @todo Add more tests for api.Menus.MenuSection behaviors
7174

0 commit comments

Comments
 (0)