aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorFelix Nagel <info@felixnagel.com>2012-12-15 01:10:32 +0100
committerFelix Nagel <info@felixnagel.com>2012-12-15 01:10:32 +0100
commit8aa24dd1d52fb1f2454905a2e3bb9b86c23cb4ad (patch)
treecf465822774b24aa3fbec3ff8eddb17d14f731ae /tests
parent25023c30407b92a5c44f117df560b9c87d6d94da (diff)
parent8ec7a1b69ffd86edbef06e30ca4368600531e649 (diff)
downloadjquery-ui-8aa24dd1d52fb1f2454905a2e3bb9b86c23cb4ad.tar.gz
jquery-ui-8aa24dd1d52fb1f2454905a2e3bb9b86c23cb4ad.zip
Merge branch 'master' into selectmenu
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/autocomplete/autocomplete_common.js2
-rw-r--r--tests/unit/autocomplete/autocomplete_options.js8
-rw-r--r--tests/unit/button/button_core.js2
-rw-r--r--tests/unit/menu/menu_methods.js2
-rw-r--r--tests/unit/progressbar/progressbar_core.js25
5 files changed, 32 insertions, 7 deletions
diff --git a/tests/unit/autocomplete/autocomplete_common.js b/tests/unit/autocomplete/autocomplete_common.js
index e1d24ef8d..63b24d384 100644
--- a/tests/unit/autocomplete/autocomplete_common.js
+++ b/tests/unit/autocomplete/autocomplete_common.js
@@ -1,6 +1,6 @@
TestHelpers.commonWidgetTests( "autocomplete", {
defaults: {
- appendTo: "body",
+ appendTo: null,
autoFocus: false,
delay: 300,
disabled: false,
diff --git a/tests/unit/autocomplete/autocomplete_options.js b/tests/unit/autocomplete/autocomplete_options.js
index 913f5bc28..9f0bd2d43 100644
--- a/tests/unit/autocomplete/autocomplete_options.js
+++ b/tests/unit/autocomplete/autocomplete_options.js
@@ -18,11 +18,11 @@ test( "appendTo", function() {
equal( $( "#ac-wrap2 .ui-autocomplete" ).length, 0, "only appends to one element" );
element.autocomplete( "destroy" );
- element.autocomplete({
- appendTo: null
- });
- equal( element.autocomplete( "widget" ).parent()[0], document.body, "null" );
+ $( "#ac-wrap2" ).addClass( "ui-front" );
+ element.autocomplete();
+ equal( element.autocomplete( "widget" ).parent()[0], $( "#ac-wrap2" )[0], "null, inside .ui-front" );
element.autocomplete( "destroy" );
+ $( "#ac-wrap2" ).removeClass( "ui-front" );
element.autocomplete().autocomplete( "option", "appendTo", "#ac-wrap1" );
equal( element.autocomplete( "widget" ).parent()[0], $( "#ac-wrap1" )[0], "modified after init" );
diff --git a/tests/unit/button/button_core.js b/tests/unit/button/button_core.js
index 6d0bbbe88..dbc079818 100644
--- a/tests/unit/button/button_core.js
+++ b/tests/unit/button/button_core.js
@@ -138,7 +138,7 @@ test( "#7092 - button creation that requires a matching label does not find labe
test( "#5946 - buttonset should ignore buttons that are not :visible", function() {
expect( 2 );
- $( "#radio01" ).next().andSelf().hide();
+ $( "#radio01" ).next().addBack().hide();
var set = $( "#radio0" ).buttonset({ items: "input[type=radio]:visible" });
ok( set.find( "label:eq(0)" ).is( ":not(.ui-button):not(.ui-corner-left)" ) );
ok( set.find( "label:eq(1)" ).is( ".ui-button.ui-corner-left" ) );
diff --git a/tests/unit/menu/menu_methods.js b/tests/unit/menu/menu_methods.js
index a7e78ea69..c51d123c2 100644
--- a/tests/unit/menu/menu_methods.js
+++ b/tests/unit/menu/menu_methods.js
@@ -64,7 +64,7 @@ test( "refresh submenu", function() {
expect( 2 );
var element = $( "#menu2" ).menu();
equal( element.find( "ul:first .ui-menu-item" ).length, 3 );
- element.find( "ul" ).andSelf().append( "<li><a href=\"#\">New Item</a></li>" );
+ element.find( "ul" ).addBack().append( "<li><a href=\"#\">New Item</a></li>" );
element.menu("refresh");
equal( element.find( "ul:first .ui-menu-item" ).length, 4 );
});
diff --git a/tests/unit/progressbar/progressbar_core.js b/tests/unit/progressbar/progressbar_core.js
index cffd84d21..8f4a138ce 100644
--- a/tests/unit/progressbar/progressbar_core.js
+++ b/tests/unit/progressbar/progressbar_core.js
@@ -1,5 +1,30 @@
module( "progressbar: core" );
+test( "markup structure", function() {
+ expect( 5 );
+ var element = $( "#progressbar" ).progressbar();
+ ok( element.hasClass( "ui-progressbar" ), "main element is .ui-progressbar" );
+ ok( !element.hasClass( "ui-progressbar-indeterminate" ),
+ "main element is not .ui-progressbar-indeterminate" );
+ equal( element.children().length, 1, "main element contains one child" );
+ ok( element.children().eq( 0 ).hasClass( "ui-progressbar-value" ),
+ "child is .ui-progressbar-value" );
+ equal( element.children().children().length, 0, "no overlay div" );
+});
+
+test( "markup structure - indeterminate", function() {
+ expect( 5 );
+ var element = $( "#progressbar" ).progressbar({ value: false });
+ ok( element.hasClass( "ui-progressbar" ), "main element is .ui-progressbar" );
+ ok( element.hasClass( "ui-progressbar-indeterminate" ),
+ "main element is .ui-progressbar-indeterminate" );
+ equal( element.children().length, 1, "main element contains one child" );
+ ok( element.children().eq( 0 ).hasClass( "ui-progressbar-value" ),
+ "child is .ui-progressbar-value" );
+ equal( element.children().children( ".ui-progressbar-overlay" ).length, 1,
+ ".ui-progressbar-value has .ui-progressbar-overlay" );
+});
+
test( "accessibility", function() {
expect( 11 );
var element = $( "#progressbar" ).progressbar();