aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/testsuite.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-04-23 10:43:01 -0400
committerScott González <scott.gonzalez@gmail.com>2012-04-23 10:43:01 -0400
commitb042f8ebd68e21155edb090917051353fe7a0162 (patch)
tree1d6dc4dad3b5dabb1ad971bca72d8f4bc3b4c99a /tests/unit/testsuite.js
parent7a5a77da50e5e2401043410434c49971ce504653 (diff)
downloadjquery-ui-b042f8ebd68e21155edb090917051353fe7a0162.tar.gz
jquery-ui-b042f8ebd68e21155edb090917051353fe7a0162.zip
Tests: Moved loadResources to TestHelpers.
Diffstat (limited to 'tests/unit/testsuite.js')
-rw-r--r--tests/unit/testsuite.js39
1 files changed, 30 insertions, 9 deletions
diff --git a/tests/unit/testsuite.js b/tests/unit/testsuite.js
index 70d035684..6720000f1 100644
--- a/tests/unit/testsuite.js
+++ b/tests/unit/testsuite.js
@@ -2,12 +2,35 @@
window.TestHelpers = {};
+function includeStyle( url ) {
+ document.write( "<link rel='stylesheet' href='../../../" + url + "'>" );
+}
+
+function includeScript( url ) {
+ document.write( "<script src='../../../" + url + "'></script>" );
+}
+
+TestHelpers.loadResources = QUnit.urlParams.min ?
+ function() {
+ // TODO: proper include with theme images
+ includeStyle( "dist/jquery-ui.min.css" );
+ includeScript( "dist/jquery-ui.min.js" );
+ } :
+ function( resources ) {
+ $.each( resources.css || [], function( i, resource ) {
+ includeStyle( "themes/base/jquery." + resource + ".css" );
+ });
+ $.each( resources.js || [], function( i, resource ) {
+ includeScript( resource );
+ });
+ };
+
function testJshint( widget ) {
if ( QUnit.urlParams.nojshint ) {
return;
}
- document.write( "<script src='../../../external/jshint.js'></script>" );
+ includeScript( "external/jshint.js" );
asyncTest( "JSHint", function() {
expect( 1 );
@@ -58,17 +81,15 @@ function testWidgetDefaults( widget, defaults ) {
});
}
-var privateMethods = [
- "_createWidget",
- "destroy",
- "option",
- "_trigger"
-];
-
function testWidgetOverrides( widget ) {
if ( $.uiBackCompat === false ) {
test( "$.widget overrides", function() {
- $.each( privateMethods, function( i, method ) {
+ $.each([
+ "_createWidget",
+ "destroy",
+ "option",
+ "_trigger"
+ ], function( i, method ) {
strictEqual( $.ui[ widget ].prototype[ method ],
$.Widget.prototype[ method ], "should not override " + method );
});