diff --git a/tests/unit/progressbar/progressbar_core.js b/tests/unit/progressbar/progressbar_core.js index a0ea6c48fa..0a2ef895bd 100644 --- a/tests/unit/progressbar/progressbar_core.js +++ b/tests/unit/progressbar/progressbar_core.js @@ -1,28 +1,20 @@ -/* - * progressbar_core.js - */ +module( "progressbar: core" ); -var el; +test( "accessibility", function() { + expect( 7 ); + var element = $( "#progressbar" ).progressbar(); -(function($) { + equal( element.attr( "role" ), "progressbar", "aria role" ); + equal( element.attr( "aria-valuemin" ), 0, "aria-valuemin" ); + equal( element.attr( "aria-valuemax" ), 100, "aria-valuemax" ); + equal( element.attr( "aria-valuenow" ), 0, "aria-valuenow initially" ); -module("progressbar: core"); + element.progressbar( "value", 77 ); + equal( element.attr( "aria-valuenow" ), 77, "aria-valuenow" ); -test("accessibility", function() { - expect(7); - el = $("#progressbar").progressbar(); + element.progressbar( "disable" ); + equal( element.attr( "aria-disabled" ), "true", "aria-disabled on" ); - equal(el.attr("role"), "progressbar", "aria role"); - equal(el.attr("aria-valuemin"), 0, "aria-valuemin"); - equal(el.attr("aria-valuemax"), 100, "aria-valuemax"); - equal(el.attr("aria-valuenow"), 0, "aria-valuenow initially"); - el.progressbar("value", 77); - equal(el.attr("aria-valuenow"), 77, "aria-valuenow"); - el.progressbar("disable"); - equal(el.attr("aria-disabled"), "true", "aria-disabled on"); - el.progressbar("enable"); - // FAIL: for some reason IE6 and 7 return a boolean false instead of the string - equal(el.attr("aria-disabled"), "false", "aria-disabled off"); + element.progressbar( "enable" ); + equal( element.attr( "aria-disabled" ), "false", "aria-disabled off" ); }); - -})(jQuery); diff --git a/tests/unit/progressbar/progressbar_events.js b/tests/unit/progressbar/progressbar_events.js index f3713171b4..bb0d3ca5cf 100644 --- a/tests/unit/progressbar/progressbar_events.js +++ b/tests/unit/progressbar/progressbar_events.js @@ -1,51 +1,43 @@ -/* - * progressbar_events.js - */ -(function($) { +module( "progressbar: events" ); -module("progressbar: events"); - -test("create", function() { - expect(1); - $("#progressbar").progressbar({ +test( "create", function() { + expect( 1 ); + $( "#progressbar" ).progressbar({ value: 5, create: function() { - deepEqual(5, $(this).progressbar("value") ); + deepEqual( 5, $( this ).progressbar( "value" ) ); }, change: function() { - ok(false, 'create() has triggered change()'); + ok( false, "create() has triggered change()" ); } }); }); -test("change", function() { - expect(1); - $("#progressbar").progressbar({ +test( "change", function() { + expect( 1 ); + $( "#progressbar" ).progressbar({ change: function() { - deepEqual( 5, $(this).progressbar("value") ); + deepEqual( 5, $( thisĀ ).progressbar( "value" ) ); } - }).progressbar("value", 5); + }).progressbar( "value", 5 ); }); test( "complete", function() { expect( 3 ); - var changes = 0, - value; - - $( "#progressbar" ).progressbar({ - change: function() { - changes++; - deepEqual( $( this ).progressbar( "value" ), value, "change at " + value ); - }, - complete: function() { - equal( changes, 2, "complete triggered after change" ); - } - }); + var value, + changes = 0, + element = $( "#progressbar" ).progressbar({ + change: function() { + changes++; + deepEqual( element.progressbar( "value" ), value, "change at " + value ); + }, + complete: function() { + equal( changes, 2, "complete triggered after change" ); + } + }); value = 5; - $( "#progressbar" ).progressbar( "value", value ); + element.progressbar( "value", value ); value = 100; - $( "#progressbar" ).progressbar( "value", value ); + element.progressbar( "value", value ); }); - -})(jQuery); diff --git a/tests/unit/progressbar/progressbar_methods.js b/tests/unit/progressbar/progressbar_methods.js index 966c0c55a7..89478b9b13 100644 --- a/tests/unit/progressbar/progressbar_methods.js +++ b/tests/unit/progressbar/progressbar_methods.js @@ -1,36 +1,17 @@ -/* - * progressbar_methods.js - */ -(function($) { - -module("progressbar: methods"); - -test("init", function() { - expect(1); - - $("
").appendTo('body').progressbar().remove(); - ok(true, '.progressbar() called on element'); +module( "progressbar: methods" ); +test( "destroy", function() { + expect( 1 ); + domEqual( "#progressbar", function() { + $( "#progressbar" ).progressbar().progressbar( "destroy" ); + }); }); -test("destroy", function() { - expect(2); +test( "value", function() { + expect( 3 ); - $("").appendTo('body').progressbar().progressbar("destroy").remove(); - ok(true, '.progressbar("destroy") called on element'); - - var expected = $('').progressbar(), - actual = expected.progressbar('destroy'); - equal(actual, expected, 'destroy is chainable'); + var element = $( "