Skip to content

Commit 3d78af4

Browse files
committed
(fix) Tests: Replace resource loader with AMD
Do not indent inside define blocks
1 parent a99354d commit 3d78af4

File tree

5 files changed

+283
-283
lines changed

5 files changed

+283
-283
lines changed

tests/unit/accordion/accordion.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ define([
66
"./accordion_options"
77
], function( common, core, events, methods, options ) {
88

9-
common();
10-
core();
11-
events();
12-
methods();
13-
options();
9+
common();
10+
core();
11+
events();
12+
methods();
13+
options();
1414

1515
});

tests/unit/accordion/accordion_common.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,26 @@ define([
55

66
return function() {
77

8-
testHelper.commonWidgetTests( "accordion", {
9-
defaults: {
10-
active: 0,
11-
animate: {},
12-
collapsible: false,
13-
disabled: false,
14-
event: "click",
15-
header: "> li > :first-child,> :not(li):even",
16-
heightStyle: "auto",
17-
icons: {
18-
"activeHeader": "ui-icon-triangle-1-s",
19-
"header": "ui-icon-triangle-1-e"
20-
},
8+
testHelper.commonWidgetTests( "accordion", {
9+
defaults: {
10+
active: 0,
11+
animate: {},
12+
collapsible: false,
13+
disabled: false,
14+
event: "click",
15+
header: "> li > :first-child,> :not(li):even",
16+
heightStyle: "auto",
17+
icons: {
18+
"activeHeader": "ui-icon-triangle-1-s",
19+
"header": "ui-icon-triangle-1-e"
20+
},
2121

22-
// callbacks
23-
activate: null,
24-
beforeActivate: null,
25-
create: null
26-
}
27-
});
22+
// callbacks
23+
activate: null,
24+
beforeActivate: null,
25+
create: null
26+
}
27+
});
2828

2929
};
3030

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
define(function() {
22

3-
return {
4-
equalHeight: function( accordion, height ) {
5-
accordion.find( ".ui-accordion-content" ).each(function() {
6-
equal( $( this ).outerHeight(), height );
7-
});
8-
},
3+
return {
4+
equalHeight: function( accordion, height ) {
5+
accordion.find( ".ui-accordion-content" ).each(function() {
6+
equal( $( this ).outerHeight(), height );
7+
});
8+
},
99

10-
setupTeardown: function() {
11-
var animate = $.ui.accordion.prototype.options.animate;
12-
return {
13-
setup: function() {
14-
$.ui.accordion.prototype.options.animate = false;
15-
},
16-
teardown: function() {
17-
$.ui.accordion.prototype.options.animate = animate;
18-
}
19-
};
20-
},
10+
setupTeardown: function() {
11+
var animate = $.ui.accordion.prototype.options.animate;
12+
return {
13+
setup: function() {
14+
$.ui.accordion.prototype.options.animate = false;
15+
},
16+
teardown: function() {
17+
$.ui.accordion.prototype.options.animate = animate;
18+
}
19+
};
20+
},
2121

22-
state: function( accordion ) {
23-
var expected = $.makeArray( arguments ).slice( 1 ),
24-
actual = accordion.find( ".ui-accordion-content" ).map(function() {
25-
return $( this ).css( "display" ) === "none" ? 0 : 1;
26-
}).get();
27-
QUnit.push( QUnit.equiv(actual, expected), actual, expected );
28-
}
22+
state: function( accordion ) {
23+
var expected = $.makeArray( arguments ).slice( 1 ),
24+
actual = accordion.find( ".ui-accordion-content" ).map(function() {
25+
return $( this ).css( "display" ) === "none" ? 0 : 1;
26+
}).get();
27+
QUnit.push( QUnit.equiv(actual, expected), actual, expected );
28+
}
2929

30-
};
30+
};
3131

3232
});

tests/unit/helper/css.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
(function() {
22

3-
if( !window.helper ) {
4-
window.helper = {};
5-
}
3+
if( !window.helper ) {
4+
window.helper = {};
5+
}
66

7-
function includeStyle( url ) {
8-
document.write( "<link rel='stylesheet' href='../../../" + url + "'>" );
9-
}
7+
function includeStyle( url ) {
8+
document.write( "<link rel='stylesheet' href='../../../" + url + "'>" );
9+
}
1010

11-
window.helper.loadCss = function( styles ) {
12-
var i;
13-
for( i = 0; i < styles.length; i++ ) {
14-
includeStyle( "themes/base/" + styles[ i ] + ".css" );
15-
}
16-
};
11+
window.helper.loadCss = function( styles ) {
12+
var i;
13+
for( i = 0; i < styles.length; i++ ) {
14+
includeStyle( "themes/base/" + styles[ i ] + ".css" );
15+
}
16+
};
1717

1818
}());

0 commit comments

Comments
 (0)