progressbar tests: started refactor

This commit is contained in:
Richard Worth 2008-11-24 13:52:13 +00:00
parent 19a7d6bc5b
commit 0ef9a8ac3d

View File

@ -8,10 +8,10 @@
var defaults = { var defaults = {
disabled: false, disabled: false,
duration: 1000, height: 20,
increment: 1, label: true,
interval: 1000, labelAlign: 'left',
range: true, value: 0,
width: 300 width: 300
}; };
@ -46,20 +46,19 @@ test("defaults", function() {
}); });
test("set defaults on init", function() { test("set defaults on init", function() {
expect(5);
el = $("#progressbar").progressbar({ el = $("#progressbar").progressbar({
width: 500, height: 30,
duration: 5000, label: false,
interval: 500, labelAlign: 'right',
increment: 5, value: 50,
range: false width: 200
}); });
equals(el.data("width.progressbar"), 500, "width"); equals(el.progressbar("option", "height"), 30, "height");
equals(el.data("duration.progressbar"), 5000, "duration"); equals(el.progressbar("option", "label"), false, "label");
equals(el.data("interval.progressbar"), 500, "interval"); equals(el.progressbar("option", "labelAlign"), "right", "labelAlign");
equals(el.data("increment.progressbar"), 5, "increment"); equals(el.progressbar("option", "value"), 50, "value");
equals(el.data("range.progressbar"), false, "range"); equals(el.progressbar("option", "width"), 200, "width");
}); });
@ -71,7 +70,7 @@ test("accessibility", function() {
equals(el.attr("aria-valuemin"), 0, "aria-valuemin"); equals(el.attr("aria-valuemin"), 0, "aria-valuemin");
equals(el.attr("aria-valuemax"), 100, "aria-valuemax"); equals(el.attr("aria-valuemax"), 100, "aria-valuemax");
equals(el.attr("aria-valuenow"), 0, "aria-valuenow initially"); equals(el.attr("aria-valuenow"), 0, "aria-valuenow initially");
el.progressbar("progress", 77); el.progressbar("value", 77);
equals(el.attr("aria-valuenow"), 77, "aria-valuenow"); equals(el.attr("aria-valuenow"), 77, "aria-valuenow");
el.progressbar("disable"); el.progressbar("disable");
equals(el.attr("aria-disabled"), "true", "aria-disabled"); equals(el.attr("aria-disabled"), "true", "aria-disabled");