Skip to content
Permalink
Browse files

Tests: Style updates

Ref #14246
Ref gh-1588
  • Loading branch information
arschmitz committed Aug 21, 2015
1 parent 8e28f47 commit c13ddf22ed33ea23e5410735c118550a673feb58
Showing with 33 additions and 33 deletions.
  1. +6 −6 tests/lib/bootstrap.js
  2. +14 −14 tests/lib/common.js
  3. +1 −1 tests/lib/css.js
  4. +4 −4 tests/lib/helper.js
  5. +4 −4 tests/lib/qunit-assert-domequal.js
  6. +4 −4 tests/lib/qunit.js
@@ -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" );
}
@@ -1,4 +1,4 @@
define([
define( [
"jquery"
], function( $ ) {

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

@@ -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;

});
} );
@@ -1,4 +1,4 @@
(function() {
( function() {

function includeStyle( url ) {
document.write( "<link rel='stylesheet' href='../../../" + url + "'>" );
@@ -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;

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

0 comments on commit c13ddf2

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