From 3909e6d89e01e4cd8777377c63037896bb95aa2f Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Fri, 25 Nov 2011 21:18:19 +0100 Subject: new jq layout --- .../tests/unit/progressbar/progressbar_events.js | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_events.js (limited to 'src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_events.js') diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_events.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_events.js new file mode 100644 index 0000000..585c090 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_events.js @@ -0,0 +1,51 @@ +/* + * progressbar_events.js + */ +(function($) { + +module("progressbar: events"); + +test("create", function() { + expect(1); + $("#progressbar").progressbar({ + value: 5, + create: function() { + same(5, $(this).progressbar("value") ); + }, + change: function() { + ok(false, 'create() has triggered change()'); + } + }) +}); + +test("change", function() { + expect(1); + $("#progressbar").progressbar({ + change: function() { + same( 5, $(this).progressbar("value") ); + } + }).progressbar("value", 5); +}); + +test( "complete", function() { + expect( 3 ); + var changes = 0, + value; + + $( "#progressbar" ).progressbar({ + change: function() { + changes++; + same( $( this ).progressbar( "value" ), value, "change at " + value ); + }, + complete: function() { + equal( changes, 2, "complete triggered after change" ); + } + }); + + value = 5; + $( "#progressbar" ).progressbar( "value", value ); + value = 100; + $( "#progressbar" ).progressbar( "value", value ); +}); + +})(jQuery); -- cgit v1.1