diff options
author | Alexander Schmitz <arschmitz@gmail.com> | 2015-02-02 19:38:53 -0500 |
---|---|---|
committer | Alexander Schmitz <arschmitz@gmail.com> | 2015-03-11 16:05:41 -0400 |
commit | 61232cb745535687a4c26dac149c9f9f083c518c (patch) | |
tree | c60e4530f564fcdc675aeecd9d27d9801821bb03 | |
parent | 7b01dc3d2c14e34740d344e2a0f714ed59915d2c (diff) | |
download | jquery-ui-61232cb745535687a4c26dac149c9f9f083c518c.tar.gz jquery-ui-61232cb745535687a4c26dac149c9f9f083c518c.zip |
Widget: Use new has/lacksClasses assertions for all class checks
-rw-r--r-- | tests/unit/widget/widget_core.js | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/tests/unit/widget/widget_core.js b/tests/unit/widget/widget_core.js index 4e5b02349..74d6af9da 100644 --- a/tests/unit/widget/widget_core.js +++ b/tests/unit/widget/widget_core.js @@ -983,7 +983,7 @@ test( "_off() - all events", function() { element.trigger( "bar" ); }); -test( "._hoverable()", function() { +test( "._hoverable()", function( assert ) { expect( 10 ); $.widget( "ui.testWidget", { _create: function() { @@ -992,30 +992,30 @@ test( "._hoverable()", function() { }); var div = $( "#widget" ).testWidget().children(); - ok( !div.hasClass( "ui-state-hover" ), "not hovered on init" ); + assert.lacksClasses( div, "ui-state-hover", "not hovered on init" ); div.trigger( "mouseenter" ); - ok( div.hasClass( "ui-state-hover" ), "hovered after mouseenter" ); + assert.hasClasses( div, "ui-state-hover", "hovered after mouseenter" ); div.trigger( "mouseleave" ); - ok( !div.hasClass( "ui-state-hover" ), "not hovered after mouseleave" ); + assert.lacksClasses( div, "ui-state-hover", "not hovered after mouseleave" ); div.trigger( "mouseenter" ); - ok( div.hasClass( "ui-state-hover" ), "hovered after mouseenter" ); + assert.hasClasses( div, "ui-state-hover", "hovered after mouseenter" ); $( "#widget" ).testWidget( "disable" ); - ok( !div.hasClass( "ui-state-hover" ), "not hovered while disabled" ); + assert.lacksClasses( div, "ui-state-hover", "not hovered while disabled" ); div.trigger( "mouseenter" ); - ok( !div.hasClass( "ui-state-hover" ), "can't hover while disabled" ); + assert.lacksClasses( div, "ui-state-hover", "can't hover while disabled" ); $( "#widget" ).testWidget( "enable" ); - ok( !div.hasClass( "ui-state-hover" ), "enabling doesn't reset hover" ); + assert.lacksClasses( div, "ui-state-hover", "enabling doesn't reset hover" ); div.trigger( "mouseenter" ); - ok( div.hasClass( "ui-state-hover" ), "hovered after mouseenter" ); + assert.hasClasses( div, "ui-state-hover", "hovered after mouseenter" ); $( "#widget" ).testWidget( "destroy" ); - ok( !div.hasClass( "ui-state-hover" ), "not hovered after destroy" ); + assert.lacksClasses( div, "ui-state-hover", "not hovered after destroy" ); div.trigger( "mouseenter" ); - ok( !div.hasClass( "ui-state-hover" ), "event handler removed on destroy" ); + assert.lacksClasses( div, "ui-state-hover", "event handler removed on destroy" ); }); -test( "._focusable()", function() { +test( "._focusable()", function( assert ) { expect( 10 ); $.widget( "ui.testWidget", { _create: function() { @@ -1024,27 +1024,27 @@ test( "._focusable()", function() { }); var div = $( "#widget" ).testWidget().children(); - ok( !div.hasClass( "ui-state-focus" ), "not focused on init" ); + assert.lacksClasses( div, "ui-state-focus", "not focused on init" ); div.trigger( "focusin" ); - ok( div.hasClass( "ui-state-focus" ), "focused after explicit focus" ); + assert.hasClasses( div, "ui-state-focus", "focused after explicit focus" ); div.trigger( "focusout" ); - ok( !div.hasClass( "ui-state-focus" ), "not focused after blur" ); + assert.lacksClasses( div, "ui-state-focus", "not focused after blur" ); div.trigger( "focusin" ); - ok( div.hasClass( "ui-state-focus" ), "focused after explicit focus" ); + assert.hasClasses( div, "ui-state-focus", "focused after explicit focus" ); $( "#widget" ).testWidget( "disable" ); - ok( !div.hasClass( "ui-state-focus" ), "not focused while disabled" ); + assert.lacksClasses( div, "ui-state-focus", "not focused while disabled" ); div.trigger( "focusin" ); - ok( !div.hasClass( "ui-state-focus" ), "can't focus while disabled" ); + assert.lacksClasses( div, "ui-state-focus", "can't focus while disabled" ); $( "#widget" ).testWidget( "enable" ); - ok( !div.hasClass( "ui-state-focus" ), "enabling doesn't reset focus" ); + assert.lacksClasses( div, "ui-state-focus", "enabling doesn't reset focus" ); div.trigger( "focusin" ); - ok( div.hasClass( "ui-state-focus" ), "focused after explicit focus" ); + assert.hasClasses( div, "ui-state-focus", "focused after explicit focus" ); $( "#widget" ).testWidget( "destroy" ); - ok( !div.hasClass( "ui-state-focus" ), "not focused after destroy" ); + assert.lacksClasses( div, "ui-state-focus", "not focused after destroy" ); div.trigger( "focusin" ); - ok( !div.hasClass( "ui-state-focus" ), "event handler removed on destroy" ); + assert.lacksClasses( div, "ui-state-focus", "event handler removed on destroy" ); }); test( "._trigger() - no event, no ui", function() { |