aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/progressbar/core.js
diff options
context:
space:
mode:
authorAmanpreet Singh <apsdehal@gmail.com>2016-04-06 18:38:28 +0530
committerAmanpreet Singh <apsdehal@gmail.com>2016-04-14 00:08:29 +0530
commitb7b53d2163f2d602b454f3a1a17a1da0032d8066 (patch)
tree527dc1ca1baac0c4eb3570de9b3de9b2f3386c51 /tests/unit/progressbar/core.js
parent059b5b17a11de4ba26f3b2c5c426911ff245835d (diff)
downloadjquery-ui-b7b53d2163f2d602b454f3a1a17a1da0032d8066.tar.gz
jquery-ui-b7b53d2163f2d602b454f3a1a17a1da0032d8066.zip
Progressbar: Shift to use no globals
Diffstat (limited to 'tests/unit/progressbar/core.js')
-rw-r--r--tests/unit/progressbar/core.js47
1 files changed, 24 insertions, 23 deletions
diff --git a/tests/unit/progressbar/core.js b/tests/unit/progressbar/core.js
index 3c5ad9e68..b25032a40 100644
--- a/tests/unit/progressbar/core.js
+++ b/tests/unit/progressbar/core.js
@@ -1,12 +1,13 @@
define( [
+ "qunit",
"jquery",
"ui/widgets/progressbar"
-], function( $ ) {
+], function( QUnit, $ ) {
-module( "progressbar: core" );
+QUnit.module( "progressbar: core" );
-test( "markup structure", function( assert ) {
- expect( 7 );
+QUnit.test( "markup structure", function( assert ) {
+ assert.expect( 7 );
var element = $( "#progressbar" ).progressbar(),
value = element.children().eq( 0 );
@@ -14,51 +15,51 @@ test( "markup structure", function( assert ) {
assert.hasClasses( value, "ui-progressbar-value ui-widget-header" );
assert.lacksClasses( value, "ui-progressbar-complete" );
assert.lacksClasses( element, "ui-progressbar-indeterminate" );
- equal( element.children().length, 1, "Main element contains one child" );
+ assert.equal( element.children().length, 1, "Main element contains one child" );
element.progressbar( "option", "value", 100 );
assert.hasClasses( value, "ui-progressbar-complete ui-widget-header ui-progressbar-value" );
- equal( element.children().children().length, 0, "no overlay div" );
+ assert.equal( element.children().children().length, 0, "no overlay div" );
} );
-test( "markup structure - indeterminate", function( assert ) {
- expect( 5 );
+QUnit.test( "markup structure - indeterminate", function( assert ) {
+ assert.expect( 5 );
var element = $( "#progressbar" ).progressbar( { value: false } ),
children = element.children();
assert.hasClasses( element, "ui-progressbar ui-progressbar-indeterminate ui-widget ui-widget-content" );
assert.hasClasses( children[ 0 ], "ui-progressbar-value ui-widget-header" );
- equal( children.length, 1, "Main element contains one child" );
+ assert.equal( children.length, 1, "Main element contains one child" );
assert.hasClasses( children[ 0 ], "ui-progressbar-value" );
- equal( children.children( ".ui-progressbar-overlay" ).length, 1,
+ assert.equal( children.children( ".ui-progressbar-overlay" ).length, 1,
"Value has class ui-progressbar-overlay" );
} );
-test( "accessibility", function() {
- expect( 11 );
+QUnit.test( "accessibility", function( assert ) {
+ assert.expect( 11 );
var element = $( "#progressbar" ).progressbar();
- equal( element.attr( "role" ), "progressbar", "aria role" );
- equal( element.attr( "aria-valuemin" ), 0, "aria-valuemin" );
- equal( element.attr( "aria-valuemax" ), 100, "aria-valuemax" );
- equal( element.attr( "aria-valuenow" ), 0, "aria-valuenow initially" );
+ assert.equal( element.attr( "role" ), "progressbar", "aria role" );
+ assert.equal( element.attr( "aria-valuemin" ), 0, "aria-valuemin" );
+ assert.equal( element.attr( "aria-valuemax" ), 100, "aria-valuemax" );
+ assert.equal( element.attr( "aria-valuenow" ), 0, "aria-valuenow initially" );
element.progressbar( "value", 77 );
- equal( element.attr( "aria-valuenow" ), 77, "aria-valuenow" );
+ assert.equal( element.attr( "aria-valuenow" ), 77, "aria-valuenow" );
element.progressbar( "option", "max", 150 );
- equal( element.attr( "aria-valuemax" ), 150, "aria-valuemax" );
+ assert.equal( element.attr( "aria-valuemax" ), 150, "aria-valuemax" );
element.progressbar( "disable" );
- equal( element.attr( "aria-disabled" ), "true", "aria-disabled on" );
+ assert.equal( element.attr( "aria-disabled" ), "true", "aria-disabled on" );
element.progressbar( "enable" );
- equal( element.attr( "aria-disabled" ), "false", "aria-disabled off" );
+ assert.equal( element.attr( "aria-disabled" ), "false", "aria-disabled off" );
element.progressbar( "option", "value", false );
- equal( element.attr( "aria-valuemin" ), 0, "aria-valuemin" );
- equal( element.attr( "aria-valuemax" ), 150, "aria-valuemax" );
- equal( element.attr( "aria-valuenow" ), null, "aria-valuenow" );
+ assert.equal( element.attr( "aria-valuemin" ), 0, "aria-valuemin" );
+ assert.equal( element.attr( "aria-valuemax" ), 150, "aria-valuemax" );
+ assert.equal( element.attr( "aria-valuenow" ), null, "aria-valuenow" );
} );
} );