Tests: Style updates

Ref #14246
Ref gh-1588
This commit is contained in:
Alexander Schmitz 2015-08-21 00:13:44 -04:00
parent 8e28f474e5
commit c13ddf22ed
6 changed files with 33 additions and 33 deletions

View File

@ -1,6 +1,6 @@
( function() {
requirejs.config({
requirejs.config( {
paths: {
"globalize": "../../../external/globalize/globalize",
"globalize/ja-JP": "../../../external/globalize/globalize.culture.ja-JP",
@ -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: {
@ -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( $ ) {
@ -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" );
@ -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" );
}

View File

@ -1,4 +1,4 @@
define([
define( [
"jquery"
], function( $ ) {
@ -17,8 +17,8 @@ function testWidgetDefaults( widget, defaults ) {
return;
}
deepEqual( pluginDefaults[ key ], val, key );
});
});
} );
} );
// Ensure that all defaults were tested
test( "tested defaults", function() {
@ -26,15 +26,15 @@ function testWidgetDefaults( widget, defaults ) {
$.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",
@ -42,8 +42,8 @@ function testWidgetOverrides( widget ) {
], function( i, method ) {
strictEqual( $.ui[ widget ].prototype[ method ],
$.Widget.prototype[ method ], "should not override " + method );
});
});
} );
} );
}
}
@ -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 ) {
@ -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 ) {
@ -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;
});
} );

View File

@ -1,4 +1,4 @@
(function() {
( function() {
function includeStyle( url ) {
document.write( "<link rel='stylesheet' href='../../../" + url + "'>" );

View File

@ -1,4 +1,4 @@
define([
define( [
"jquery"
], function( $ ) {
@ -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" );
};
@ -30,4 +30,4 @@ exports.onFocus = function( element, onFocus ) {
return exports;
});
} );

View File

@ -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();
}

View File

@ -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: [
@ -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() {