2009-02-02 14:36:08 +00:00
|
|
|
/*
|
|
|
|
* progressbar_methods.js
|
|
|
|
*/
|
|
|
|
(function($) {
|
|
|
|
|
|
|
|
module("progressbar: methods");
|
|
|
|
|
2009-02-04 04:39:31 +00:00
|
|
|
test("init", function() {
|
|
|
|
expect(1);
|
|
|
|
|
|
|
|
$("<div></div>").appendTo('body').progressbar().remove();
|
|
|
|
ok(true, '.progressbar() called on element');
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
test("destroy", function() {
|
2009-04-15 02:33:28 +00:00
|
|
|
expect(2);
|
2009-02-04 04:39:31 +00:00
|
|
|
|
|
|
|
$("<div></div>").appendTo('body').progressbar().progressbar("destroy").remove();
|
|
|
|
ok(true, '.progressbar("destroy") called on element');
|
|
|
|
|
2009-04-15 02:33:28 +00:00
|
|
|
var expected = $('<div></div>').progressbar(),
|
|
|
|
actual = expected.progressbar('destroy');
|
2012-02-28 14:56:32 +00:00
|
|
|
equal(actual, expected, 'destroy is chainable');
|
2009-02-02 14:36:08 +00:00
|
|
|
});
|
|
|
|
|
2009-04-16 01:57:56 +00:00
|
|
|
test('value', function() {
|
|
|
|
expect(3);
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2009-04-16 01:57:56 +00:00
|
|
|
var el = $('<div></div>').progressbar({ value: 20 });
|
2012-02-28 14:56:32 +00:00
|
|
|
equal(el.progressbar('value'), 20, 'correct value as getter');
|
|
|
|
equal(el.progressbar('value', 30), el, 'chainable as setter');
|
|
|
|
equal(el.progressbar('option', 'value'), 30, 'correct value after setter');
|
2009-04-16 01:57:56 +00:00
|
|
|
});
|
|
|
|
|
2009-02-02 14:36:08 +00:00
|
|
|
})(jQuery);
|