Skip to content
Permalink
Browse files

Progressbar test: init

  • Loading branch information
chicheng committed Aug 19, 2008
1 parent 951312c commit b4e2e0e9ca4d0993920baba4cc0f50cba4362323
Showing with 99 additions and 0 deletions.
  1. +4 −0 tests/all.html
  2. +39 −0 tests/progressbar.html
  3. +56 −0 tests/progressbar.js
@@ -12,6 +12,7 @@
<script type="text/javascript" src="../ui/ui.dialog.js"></script>
<script type="text/javascript" src="../ui/ui.draggable.js"></script>
<script type="text/javascript" src="../ui/ui.droppable.js"></script>
<script type="text/javascript" src="../ui/ui.progressbar.js"></script>
<script type="text/javascript" src="../ui/ui.resizable.js"></script>
<script type="text/javascript" src="../ui/ui.selectable.js"></script>
<script type="text/javascript" src="../ui/ui.slider.js"></script>
@@ -27,6 +28,7 @@
<script type="text/javascript" src="datepicker.js"></script>
<script type="text/javascript" src="dialog.js"></script>
<script type="text/javascript" src="draggable.js"></script>
<script type="text/javascript" src="progressbar.js"></script>
<script type="text/javascript" src="resizable.js"></script>
<script type="text/javascript" src="selectable.js"></script>
<script type="text/javascript" src="slider.js"></script>
@@ -200,6 +202,8 @@ <h4>Run individual testsuites or doubleclick a test below</h4>

<input type="text" id="spin" />

<div id="progressbar"></div>

</div>
</body>
</html>
@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>jQuery UI Progressbar Test Suite</title>

<link rel="stylesheet" href="qunit/testsuite.css" type="text/css" media="screen">

<script type="text/javascript" src="../jquery-1.2.6.js"></script>
<script type="text/javascript" src="../ui/ui.core.js"></script>
<script type="text/javascript" src="../ui/ui.progressbar.js"></script>

<script type="text/javascript" src="qunit/testrunner.js"></script>
<script type="text/javascript" src="simulate/jquery.simulate.js"></script>

<script type="text/javascript" src="progressbar.js"></script>

<style type="text/css">
</style>



</head>
<body>

<h1 id="header">jQuery UI Progressbar Test Suite</h1>
<h2 id="banner"></h2>
<h2 id="userAgent"></h2>

<ol id="tests"></ol>

<div id="main" style="position:absolute;top:-20000px">
<div id="progressbar"></div>
</div>

</body>
</html>
@@ -0,0 +1,56 @@
/*
* progressbar unit tests
*/
(function($) {

// Spinner Tests
module("progressbar");

test("init", function() {
expect(1);

el = $("#progressbar").progressbar();
ok(true, '.progressbar() called on element');

});

test("destroy", function() {
expect(1);

$("#progressbar").progressbar().progressbar("destroy");
ok(true, '.progressbar("destroy") called on element');

});

test("defaults", function() {
expect(5);
el = $("#progressbar").progressbar();

equals(el.data("width.progressbar"), 300, "width");
equals(el.data("duration.progressbar"), 3000, "duration");
equals(el.data("interval.progressbar"), 200, "interval");
equals(el.data("increment.progressbar"), 1, "increment");
equals(el.data("range.progressbar"), true, "range");

});

test("set defaults on init", function() {
expect(5);
el = $("#progressbar").progressbar({
width: 500,
duration: 5000,
interval: 500,
increment: 5,
range: false
});

equals(el.data("width.progressbar"), 500, "width");
equals(el.data("duration.progressbar"), 5000, "duration");
equals(el.data("interval.progressbar"), 500, "interval");
equals(el.data("increment.progressbar"), 5, "increment");
equals(el.data("range.progressbar"), false, "range");

});


})(jQuery);

0 comments on commit b4e2e0e

Please sign in to comment.
You can’t perform that action at this time.