]> source.dussan.org Git - jquery-ui.git/commitdiff
Dialog: address review comments
authorAlexander Schmitz <arschmitz@gmail.com>
Wed, 16 Sep 2015 05:50:53 +0000 (01:50 -0400)
committerAlexander Schmitz <arschmitz@gmail.com>
Thu, 8 Oct 2015 18:02:57 +0000 (14:02 -0400)
tests/unit/dialog/options.js

index 5aa9587567f308de11d728359bcec3fb4ae62aa3..b12db5d33926fbd4561e30d493875e46bcbdaaa7 100644 (file)
@@ -165,7 +165,7 @@ test( "buttons - advanced", function( assert ) {
        buttons = element.dialog( "widget" ).find( ".ui-dialog-buttonpane button" );
        equal( buttons.length, 1, "correct number of buttons" );
        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" );
        deepEqual( buttons.button( "option", "icon" ), "ui-icon-cancel" );
        equal( buttons.button( "option", "showLabel" ), false );
@@ -209,17 +209,17 @@ test( "closeText", function() {
        expect( 3 );
 
        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" );
        element.remove();
 
        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" );
        element.remove();
 
        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" );
        element.remove();
 } );