Skip to content

Commit

Permalink
Tests: Style updates
Browse files Browse the repository at this point in the history
Ref #14246
Ref gh-1588
  • Loading branch information
arschmitz committed Aug 21, 2015
1 parent 8e28f47 commit c13ddf2
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 33 deletions.
12 changes: 6 additions & 6 deletions tests/lib/bootstrap.js
@@ -1,6 +1,6 @@
( function() {

requirejs.config({
requirejs.config( {
paths: {
"globalize": "../../../external/globalize/globalize",
"globalize/ja-JP": "../../../external/globalize/globalize.culture.ja-JP",
Expand All @@ -12,7 +12,7 @@ requirejs.config({
"qunit-assert-classes": "../../../external/qunit-assert-classes/qunit-assert-classes",
"qunit-assert-close": "../../../external/qunit-assert-close/qunit-assert-close",
"qunit": "../../../external/qunit/qunit",
"testswarm": "http://swarm.jquery.org/js/inject.js?" + (new Date()).getTime(),
"testswarm": "http://swarm.jquery.org/js/inject.js?" + ( new Date() ).getTime(),
"ui": "../../../ui"
},
shim: {
Expand All @@ -21,7 +21,7 @@ requirejs.config({
"qunit-assert-close": [ "qunit" ],
"testswarm": [ "qunit" ]
}
});
} );

// Create a module that disables back compat for UI modules
define( "jquery-no-back-compat", [ "jquery" ], function( $ ) {
Expand Down Expand Up @@ -108,7 +108,7 @@ function jqueryUrl() {
// - Automatically loads common, core, events, methods, and options
// - data-deprecated: Loads the deprecated test modules for a widget
// - data-no-back-compat: Set $.uiBackCompat to false
(function() {
( function() {

// Find the script element
var scripts = document.getElementsByTagName( "script" );
Expand All @@ -128,13 +128,13 @@ function jqueryUrl() {
var noBackCompat = !!script.getAttribute( "data-no-back-compat" );

if ( widget ) {
modules = modules.concat([
modules = modules.concat( [
( deprecated ? "common-deprecated" : "common" ),
"core",
"events",
"methods",
"options"
]);
] );
if ( deprecated ) {
modules = modules.concat( "deprecated" );
}
Expand Down
28 changes: 14 additions & 14 deletions tests/lib/common.js
@@ -1,4 +1,4 @@
define([
define( [
"jquery"
], function( $ ) {

Expand All @@ -17,33 +17,33 @@ function testWidgetDefaults( widget, defaults ) {
return;
}
deepEqual( pluginDefaults[ key ], val, key );
});
});
} );
} );

// Ensure that all defaults were tested
test( "tested defaults", function() {
var count = 0;
$.each( pluginDefaults, function( key ) {
expect( ++count );
ok( key in defaults, key );
});
});
} );
} );
}

function testWidgetOverrides( widget ) {
if ( $.uiBackCompat === false ) {
test( "$.widget overrides", function() {
expect( 4 );
$.each([
$.each( [
"_createWidget",
"destroy",
"option",
"_trigger"
], function( i, method ) {
strictEqual( $.ui[ widget ].prototype[ method ],
$.Widget.prototype[ method ], "should not override " + method );
});
});
} );
} );
}
}

Expand All @@ -61,7 +61,7 @@ function testBasicUsage( widget ) {
// Ensure manipulating removed elements works (#3664)
$( defaultElement ).appendTo( "body" ).remove()[ widget ]().remove();
ok( true, "initialized on disconnected DOMElement - removed" );
});
} );
}

exports.testWidget = function( widget, settings ) {
Expand All @@ -74,7 +74,7 @@ exports.testWidget = function( widget, settings ) {
test( "version", function() {
expect( 1 );
ok( "version" in $.ui[ widget ].prototype, "version property exists" );
});
} );
};

exports.testJshint = function( module ) {
Expand Down Expand Up @@ -120,14 +120,14 @@ exports.testJshint = function( module ) {
ok( passed, errors );
start();
} )
.fail(function( hintError, srcError ) {
.fail( function( hintError, srcError ) {
ok( false, "error loading source: " + ( hintError || srcError ).statusText );
start();
} );
});
});
} );
} );
};

return exports;

});
} );
2 changes: 1 addition & 1 deletion tests/lib/css.js
@@ -1,4 +1,4 @@
(function() {
( function() {

function includeStyle( url ) {
document.write( "<link rel='stylesheet' href='../../../" + url + "'>" );
Expand Down
8 changes: 4 additions & 4 deletions tests/lib/helper.js
@@ -1,4 +1,4 @@
define([
define( [
"jquery"
], function( $ ) {

Expand All @@ -9,10 +9,10 @@ exports.forceScrollableWindow = function( appendTo ) {
// The main testable area is 10000x10000 so to enforce scrolling,
// this DIV must be greater than 10000 to work
return $( "<div>" )
.css({
.css( {
height: "11000px",
width: "11000px"
})
} )
.appendTo( appendTo || "#qunit-fixture" );
};

Expand All @@ -30,4 +30,4 @@ exports.onFocus = function( element, onFocus ) {

return exports;

});
} );
8 changes: 4 additions & 4 deletions tests/lib/qunit-assert-domequal.js
Expand Up @@ -100,20 +100,20 @@ function extract( selector, message ) {
$.each( domEqual.properties, function( index, attr ) {
var value = elem.prop( attr );
result[ attr ] = value != null ? value : "";
});
} );
$.each( domEqual.attributes, function( index, attr ) {
var value = elem.attr( attr );
result[ attr ] = value != null ? value : "";
});
} );
result.style = getElementStyles( elem[ 0 ] );
result.events = $._data( elem[ 0 ], "events" );
result.data = $.extend( {}, elem.data() );
delete result.data[ $.expando ];
children = elem.children();
if ( children.length ) {
result.children = elem.children().map(function() {
result.children = elem.children().map( function() {
return extract( $( this ) );
}).get();
} ).get();
} else {
result.text = elem.text();
}
Expand Down
8 changes: 4 additions & 4 deletions tests/lib/qunit.js
Expand Up @@ -10,13 +10,13 @@ define( [
QUnit.config.autostart = false;
QUnit.config.requireExpects = true;

QUnit.config.urlConfig.push({
QUnit.config.urlConfig.push( {
id: "nojshint",
label: "Skip JSHint",
tooltip: "Skip running JSHint, e.g., within TestSwarm, where Jenkins runs it already"
});
} );

QUnit.config.urlConfig.push({
QUnit.config.urlConfig.push( {
id: "jquery",
label: "jQuery version",
value: [
Expand All @@ -30,7 +30,7 @@ QUnit.config.urlConfig.push({
"compat-git", "git", "custom"
],
tooltip: "Which jQuery Core version to test against"
});
} );

QUnit.reset = ( function( reset ) {
return function() {
Expand Down

0 comments on commit c13ddf2

Please sign in to comment.