tests - wrapped in closures so all.html will work

This commit is contained in:
Richard Worth 2008-06-09 05:59:18 +00:00
parent d2397d8d63
commit 03528f2942
7 changed files with 45 additions and 5 deletions

View File

@ -1,3 +1,8 @@
/*
* accordion unit tests
*/
(function($) {
module("accordion");
jQuery.ui.accordion.defaults.animated = false;
@ -75,4 +80,6 @@ test("activate, jQuery or DOM element", function() {
state(ac, 1, 0, 0);
ac.accordion("activate", $("#list1 a")[1]);
state(ac, 0, 1, 0);
});
});
})(jQuery);

View File

@ -44,6 +44,10 @@
<h4>Run individual testsuites or doubleclick a test below</h4>
<ul>
<li><a href="accordion.html">Accordion</a></li>
<li><a href="dialog.html">Dialog</a></li>
<li><a href="draggable.html">Draggable</a></li>
<li><a href="resizable.html">Resizable</a></li>
<li><a href="selectable.html">Selectable</a></li>
<li><a href="slider.html">Slider</a></li>
</ul>
@ -198,6 +202,19 @@
</div>
<div id="log"><div><strong>Log of the 2nd accordion</strong></div></div>
<div id="resizable1" style="background: green; width: 100px; height: 100px;">I'm a resizable.</div>
<img src="images/test.jpg" id="resizable2" style="width: 100px; height: 100px;"/>
<ul id="selectable1">
<li>Item 1</li>
<li>Item 2</li>
<li class="special">Item 3</li>
<li>Item 4</li>
<li>Item 5</li>
</ul>
</div>
</body>
</html>

View File

@ -1,10 +1,11 @@
/*
* dialog unit tests
*/
(function($) {
//
// Dialog Test Helper Functions
//
var el,
offsetBefore, offsetAfter,
heightBefore, heightAfter,
@ -307,3 +308,5 @@ test("close", function() {
});
module("dialog: Tickets");
})(jQuery);

View File

@ -1,7 +1,7 @@
/*
* draggable unit tests
*/
(function($) {
//
// Draggable Test Helper Functions
//
@ -487,3 +487,5 @@ test("#2965 cursorAt with margin", function() {
equals(actual.top, expected.top, "10px margin. top");
});
})(jQuery);

View File

@ -1,6 +1,7 @@
/*
* resizable tests
*/
(function($) {
var drag = function(el, dx, dy, complete) {
@ -398,3 +399,5 @@ test("ui-resizable-se { handles: 'all', grid: [0, 20] } wrapped", function() {
equals( target.height(), 120, "compare height");
});
})(jQuery);

View File

@ -1,7 +1,7 @@
/*
* selectable unit tests
*/
(function($) {
//
// Selectable Test Helper Functions
//
@ -203,3 +203,5 @@ test("stop", function() {
});
module("selectable: Tickets");
})(jQuery);

View File

@ -1,3 +1,7 @@
/*
* slider unit tests
*/
(function($) {
var keyCodes = {
leftArrow: 37,
@ -107,4 +111,6 @@ test("handle creation", function() {
var instance = $.data(slider[0], "slider")
equals(instance.handle.length, 2);
ok(instance.handle.jquery, "handle must be a jquery object")
})
})
})(jQuery);