diff options
Diffstat (limited to 'tests/unit/tooltip/events.js')
-rw-r--r-- | tests/unit/tooltip/events.js | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/tests/unit/tooltip/events.js b/tests/unit/tooltip/events.js index 3cf65fc4e..3fbb683a5 100644 --- a/tests/unit/tooltip/events.js +++ b/tests/unit/tooltip/events.js @@ -1,57 +1,58 @@ define( [ + "qunit", "jquery", "ui/widgets/tooltip" -], function( $ ) { +], function( QUnit, $ ) { -module( "tooltip: events" ); +QUnit.module( "tooltip: events" ); -test( "programmatic triggers", function() { - expect( 4 ); +QUnit.test( "programmatic triggers", function( assert ) { + assert.expect( 4 ); var tooltip, element = $( "#tooltipped1" ).tooltip(); element.one( "tooltipopen", function( event, ui ) { tooltip = ui.tooltip; - ok( !( "originalEvent" in event ), "open" ); - strictEqual( ui.tooltip[ 0 ], + assert.ok( !( "originalEvent" in event ), "open" ); + assert.strictEqual( ui.tooltip[ 0 ], $( "#" + element.data( "ui-tooltip-id" ) )[ 0 ], "ui.tooltip" ); } ); element.tooltip( "open" ); element.one( "tooltipclose", function( event, ui ) { - ok( !( "originalEvent" in event ), "close" ); - strictEqual( ui.tooltip[ 0 ], tooltip[ 0 ], "ui.tooltip" ); + assert.ok( !( "originalEvent" in event ), "close" ); + assert.strictEqual( ui.tooltip[ 0 ], tooltip[ 0 ], "ui.tooltip" ); } ); element.tooltip( "close" ); } ); -test( "mouse events", function() { - expect( 2 ); +QUnit.test( "mouse events", function( assert ) { + assert.expect( 2 ); var element = $( "#tooltipped1" ).tooltip(); element.on( "tooltipopen", function( event ) { - deepEqual( event.originalEvent.type, "mouseover" ); + assert.deepEqual( event.originalEvent.type, "mouseover" ); } ); element.trigger( "mouseover" ); element.on( "tooltipclose", function( event ) { - deepEqual( event.originalEvent.type, "mouseleave" ); + assert.deepEqual( event.originalEvent.type, "mouseleave" ); } ); element.trigger( "focusout" ); element.trigger( "mouseleave" ); } ); -test( "focus events", function() { - expect( 2 ); +QUnit.test( "focus events", function( assert ) { + assert.expect( 2 ); var element = $( "#tooltipped1" ).tooltip(); element.on( "tooltipopen", function( event ) { - deepEqual( event.originalEvent.type, "focusin" ); + assert.deepEqual( event.originalEvent.type, "focusin" ); } ); element.trigger( "focusin" ); element.on( "tooltipclose", function( event ) { - deepEqual( event.originalEvent.type, "focusout" ); + assert.deepEqual( event.originalEvent.type, "focusout" ); } ); element.trigger( "mouseleave" ); element.trigger( "focusout" ); |