Dialog: address review comments

This commit is contained in:
Alexander Schmitz 2015-09-16 01:50:53 -04:00
parent 6b05034283
commit 1beeb94196

View File

@ -165,7 +165,7 @@ test( "buttons - advanced", function( assert ) {
buttons = element.dialog( "widget" ).find( ".ui-dialog-buttonpane button" ); buttons = element.dialog( "widget" ).find( ".ui-dialog-buttonpane button" );
equal( buttons.length, 1, "correct number of buttons" ); equal( buttons.length, 1, "correct number of buttons" );
equal( buttons.attr( "id" ), "my-button-id", "correct id" ); equal( buttons.attr( "id" ), "my-button-id", "correct id" );
equal( buttons.text(), " a button", "correct label" ); equal( buttons.text().trim(), "a button", "correct label" );
assert.hasClasses( buttons, "additional-class" ); assert.hasClasses( buttons, "additional-class" );
deepEqual( buttons.button( "option", "icon" ), "ui-icon-cancel" ); deepEqual( buttons.button( "option", "icon" ), "ui-icon-cancel" );
equal( buttons.button( "option", "showLabel" ), false ); equal( buttons.button( "option", "showLabel" ), false );
@ -209,17 +209,17 @@ test( "closeText", function() {
expect( 3 ); expect( 3 );
var element = $( "<div></div>" ).dialog(); var element = $( "<div></div>" ).dialog();
equal( element.dialog( "widget" ).find( ".ui-dialog-titlebar-close" ).text(), " Close", equal( element.dialog( "widget" ).find( ".ui-dialog-titlebar-close" ).text().trim(), "Close",
"default close text" ); "default close text" );
element.remove(); element.remove();
element = $( "<div></div>" ).dialog( { closeText: "foo" } ); element = $( "<div></div>" ).dialog( { closeText: "foo" } );
equal( element.dialog( "widget" ).find( ".ui-dialog-titlebar-close" ).text(), " foo", equal( element.dialog( "widget" ).find( ".ui-dialog-titlebar-close" ).text().trim(), "foo",
"closeText on init" ); "closeText on init" );
element.remove(); element.remove();
element = $( "<div></div>" ).dialog().dialog( "option", "closeText", "bar" ); element = $( "<div></div>" ).dialog().dialog( "option", "closeText", "bar" );
equal( element.dialog( "widget" ).find( ".ui-dialog-titlebar-close" ).text(), " bar", equal( element.dialog( "widget" ).find( ".ui-dialog-titlebar-close" ).text().trim(), "bar",
"closeText via option method" ); "closeText via option method" );
element.remove(); element.remove();
} ); } );