Skip to content

Commit cfc28c8

Browse files
committed
Tooltip: Use new has/lacksClasses assertions for all class checks
1 parent 1709c91 commit cfc28c8

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

tests/unit/tooltip/tooltip.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<script src="../../../external/qunit/qunit.js"></script>
1313
<script src="../../../external/jquery-simulate/jquery.simulate.js"></script>
1414
<script src="../testsuite.js"></script>
15+
<script src="../../../external/qunit-assert-classes/qunit-assert-classes.js"></script>
1516
<script>
1617
TestHelpers.loadResources({
1718
css: [ "core", "tooltip" ],

tests/unit/tooltip/tooltip_deprecated.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<script src="../../../external/qunit/qunit.js"></script>
1010
<script src="../../../external/jquery-simulate/jquery.simulate.js"></script>
1111
<script src="../testsuite.js"></script>
12+
<script src="../../../external/qunit-assert-classes/qunit-assert-classes.js"></script>
1213
<script>
1314
TestHelpers.loadResources({
1415
css: [ "core", "tooltip" ],

tests/unit/tooltip/tooltip_deprecated.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
module( "tooltip: (deprecated) options" );
44

5-
test( "tooltipClass", function() {
5+
test( "tooltipClass", function( assert ) {
66
expect( 1 );
77
var element = $( "#tooltipped1" ).tooltip({
88
tooltipClass: "custom"
99
}).tooltip( "open" );
10-
ok( $( "#" + element.data( "ui-tooltip-id" ) ).hasClass( "custom" ) );
10+
assert.hasClasses( $( "#" + element.data( "ui-tooltip-id" ) ), "custom" );
1111
});
1212

1313
}( jQuery ) );

tests/unit/tooltip/tooltip_methods.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ test( "open/close with tracking", function() {
5353
$.fx.off = false;
5454
});
5555

56-
test( "enable/disable", function() {
56+
test( "enable/disable", function( assert ) {
5757
expect( 11 );
5858
$.fx.off = true;
5959
var tooltip,
@@ -67,9 +67,9 @@ test( "enable/disable", function() {
6767
element.tooltip( "disable" );
6868
equal( $( ".ui-tooltip" ).length, 0, "no tooltip when disabled" );
6969

70-
ok( !element.tooltip( "widget" ).hasClass( "ui-state-disabled" ), "element doesn't get ui-state-disabled" );
70+
assert.lacksClasses( element.tooltip( "widget" ), "ui-state-disabled" );
7171
ok( !element.tooltip( "widget" ).attr( "aria-disabled" ), "element doesn't get aria-disabled" );
72-
ok( !element.tooltip( "widget" ).hasClass( "ui-tooltip-disabled" ), "element doesn't get ui-tooltip-disabled" );
72+
assert.lacksClasses( element.tooltip( "widget" ), "ui-tooltip-disabled" );
7373
strictEqual( tooltip.attr( "title" ), undefined, "title removed on disable" );
7474

7575
element.tooltip( "open" );

0 commit comments

Comments
 (0)