Skip to content

Commit df3e8c4

Browse files
committed
Progressbar: Convert tests to new infrastructure
Ref #10119 Ref gh-1528
1 parent 739f9b3 commit df3e8c4

File tree

6 files changed

+32
-35
lines changed

6 files changed

+32
-35
lines changed

tests/unit/progressbar/progressbar.html

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,8 @@
44
<meta charset="utf-8">
55
<title>jQuery UI Progressbar Test Suite</title>
66

7-
<script src="../../jquery.js"></script>
8-
<link rel="stylesheet" href="../../../external/qunit/qunit.css">
9-
<script src="../../../external/qunit/qunit.js"></script>
10-
<script src="../../../external/jquery-simulate/jquery.simulate.js"></script>
11-
<script src="../testsuite.js"></script>
12-
<script src="../../../external/qunit-assert-classes/qunit-assert-classes.js"></script>
13-
<script>
14-
TestHelpers.loadResources({
15-
css: [ "core", "progressbar" ],
16-
js: [
17-
"ui/core.js",
18-
"ui/widget.js",
19-
"ui/progressbar.js"
20-
]
21-
});
22-
</script>
23-
24-
<script src="progressbar_common.js"></script>
25-
<script src="progressbar_core.js"></script>
26-
<script src="progressbar_events.js"></script>
27-
<script src="progressbar_methods.js"></script>
28-
<script src="progressbar_options.js"></script>
29-
30-
<script src="../swarminject.js"></script>
7+
<script src="../../lib/css.js" data-modules="core progressbar"></script>
8+
<script src="../../lib/bootstrap.js" data-widget="progressbar"></script>
319
</head>
3210
<body>
3311

tests/unit/progressbar/progressbar_common.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
TestHelpers.commonWidgetTests( "progressbar", {
1+
define( [
2+
"lib/common",
3+
"ui/progressbar"
4+
], function( common ) {
5+
6+
common.testWidget( "progressbar", {
27
defaults: {
38
classes: {
49
"ui-progressbar": "ui-corner-all",
@@ -15,3 +20,5 @@ TestHelpers.commonWidgetTests( "progressbar", {
1520
create: null
1621
}
1722
});
23+
24+
} );

tests/unit/progressbar/progressbar_core.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
(function( $ ) {
1+
define( [
2+
"jquery",
3+
"ui/progressbar"
4+
], function( $ ) {
25

36
module( "progressbar: core" );
47

@@ -58,4 +61,4 @@ test( "accessibility", function() {
5861
equal( element.attr( "aria-valuenow" ), null, "aria-valuenow" );
5962
});
6063

61-
}( jQuery ) );
64+
} );

tests/unit/progressbar/progressbar_events.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
(function( $ ) {
1+
define( [
2+
"jquery",
3+
"ui/progressbar"
4+
], function( $ ) {
25

36
module( "progressbar: events" );
47

@@ -52,4 +55,4 @@ test( "complete", function() {
5255
element.progressbar( "value", value );
5356
});
5457

55-
}( jQuery ) );
58+
} );

tests/unit/progressbar/progressbar_methods.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
(function( $ ) {
1+
define( [
2+
"jquery",
3+
"ui/progressbar"
4+
], function( $ ) {
25

36
module( "progressbar: methods" );
47

5-
test( "destroy", function() {
8+
test( "destroy", function( assert ) {
69
expect( 1 );
7-
domEqual( "#progressbar", function() {
10+
assert.domEqual( "#progressbar", function() {
811
$( "#progressbar" ).progressbar().progressbar( "destroy" );
912
});
1013
});
@@ -36,4 +39,4 @@ test( "widget", function() {
3639
strictEqual( widgetElement[ 0 ], element[ 0 ], "same element" );
3740
});
3841

39-
}( jQuery ) );
42+
} );

tests/unit/progressbar/progressbar_options.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
(function( $ ) {
1+
define( [
2+
"jquery",
3+
"ui/progressbar"
4+
], function( $ ) {
25

36
module( "progressbar: options" );
47

@@ -73,4 +76,4 @@ test( "change max below value", function() {
7376
"value constrained at max" );
7477
});
7578

76-
}( jQuery ) );
79+
} );

0 commit comments

Comments
 (0)