aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/dialog/options.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/dialog/options.js')
-rw-r--r--tests/unit/dialog/options.js22
1 files changed, 13 insertions, 9 deletions
diff --git a/tests/unit/dialog/options.js b/tests/unit/dialog/options.js
index 1be2888e3..4d8e4f717 100644
--- a/tests/unit/dialog/options.js
+++ b/tests/unit/dialog/options.js
@@ -166,7 +166,7 @@ QUnit.test( "buttons - advanced", function( assert ) {
buttons = element.dialog( "widget" ).find( ".ui-dialog-buttonpane button" );
assert.equal( buttons.length, 1, "correct number of buttons" );
assert.equal( buttons.attr( "id" ), "my-button-id", "correct id" );
- assert.equal( $.trim( buttons.text() ), "a button", "correct label" );
+ assert.equal( String.prototype.trim.call( buttons.text() ), "a button", "correct label" );
assert.hasClasses( buttons, "additional-class" );
assert.deepEqual( buttons.button( "option", "icon" ), "ui-icon-cancel" );
assert.equal( buttons.button( "option", "showLabel" ), false );
@@ -210,22 +210,22 @@ QUnit.test( "closeText", function( assert ) {
assert.expect( 4 );
var element = $( "<div></div>" ).dialog();
- assert.equal( $.trim( element.dialog( "widget" ).find( ".ui-dialog-titlebar-close" ).text() ), "Close",
+ assert.equal( String.prototype.trim.call( element.dialog( "widget" ).find( ".ui-dialog-titlebar-close" ).text() ), "Close",
"default close text" );
element.remove();
element = $( "<div></div>" ).dialog( { closeText: "foo" } );
- assert.equal( $.trim( element.dialog( "widget" ).find( ".ui-dialog-titlebar-close" ).text() ), "foo",
+ assert.equal( String.prototype.trim.call( element.dialog( "widget" ).find( ".ui-dialog-titlebar-close" ).text() ), "foo",
"closeText on init" );
element.remove();
element = $( "<div></div>" ).dialog().dialog( "option", "closeText", "bar" );
- assert.equal( $.trim( element.dialog( "widget" ).find( ".ui-dialog-titlebar-close" ).text() ), "bar",
+ assert.equal( String.prototype.trim.call( element.dialog( "widget" ).find( ".ui-dialog-titlebar-close" ).text() ), "bar",
"closeText via option method" );
element.remove();
element = $( "<div></div>" ).dialog( { closeText: "<span>foo</span>" } );
- assert.equal( $.trim( element.dialog( "widget" ).find( ".ui-dialog-titlebar-close" ).text() ), "<span>foo</span>",
+ assert.equal( String.prototype.trim.call( element.dialog( "widget" ).find( ".ui-dialog-titlebar-close" ).text() ), "<span>foo</span>",
"closeText is escaped" );
element.remove();
} );
@@ -251,21 +251,25 @@ QUnit.test( "height", function( assert ) {
assert.expect( 4 );
var element = $( "<div></div>" ).dialog();
- assert.equal( element.dialog( "widget" ).outerHeight(), 150, "default height" );
+ assert.ok( Math.abs( element.dialog( "widget" ).outerHeight() - 150 ) < 0.25,
+ "default height within 0.25 from expected" );
element.remove();
element = $( "<div></div>" ).dialog( { height: 237 } );
- assert.equal( element.dialog( "widget" ).outerHeight(), 237, "explicit height" );
+ assert.ok( Math.abs( element.dialog( "widget" ).outerHeight() - 237 ) < 0.25,
+ "explicit height within 0.25 from expected" );
element.remove();
element = $( "<div></div>" ).dialog();
element.dialog( "option", "height", 238 );
- assert.equal( element.dialog( "widget" ).outerHeight(), 238, "explicit height set after init" );
+ assert.ok( Math.abs( element.dialog( "widget" ).outerHeight() - 238 ) < 0.25,
+ "explicit height set after init within 0.25 from expected" );
element.remove();
element = $( "<div></div>" ).css( "padding", "20px" )
.dialog( { height: 240 } );
- assert.equal( element.dialog( "widget" ).outerHeight(), 240, "explicit height with padding" );
+ assert.ok( Math.abs( element.dialog( "widget" ).outerHeight() - 240 ) < 0.25,
+ "explicit height with padding within 0.25 from expected" );
element.remove();
} );