From 693f6807c28b4636e0b985c144e15f1370ed0063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Mon, 26 Oct 2015 15:10:43 -0400 Subject: [PATCH] Draggable: Skip window bubbling test in IE 8 IE 8 implements DOM Level 2 Events which only has events propagate up to the document, not the window. Ref #10818 Ref gh-1621 --- tests/unit/draggable/core.js | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/tests/unit/draggable/core.js b/tests/unit/draggable/core.js index 9efe9d3f192..b0280c33cbd 100644 --- a/tests/unit/draggable/core.js +++ b/tests/unit/draggable/core.js @@ -345,21 +345,26 @@ test( "ui-draggable-handle managed correctly in nested draggables", function( as assert.hasClasses( child, "ui-draggable-handle", "child retains class name on destroy" ); } ); -test( "does not stop propagation to window", function( assert ) { - expect( 1 ); - var element = $( "#draggable1" ).draggable(); +// Support: IE 8 only +// IE 8 implements DOM Level 2 Events which only has events bubble up to the document. +// We skip this test since it would be impossible for it to pass in such an environment. +if ( document.documentMode !== 8 ) { + test( "does not stop propagation to window", function( assert ) { + expect( 1 ); + var element = $( "#draggable1" ).draggable(); + + var handler = function() { + assert.ok( true, "mouseup propagates to window" ); + }; + $( window ).on( "mouseup", handler ); - var handler = function() { - assert.ok( true, "mouseup propagates to window" ); - }; - $( window ).on( "mouseup", handler ); + element.simulate( "drag", { + dx: 10, + dy: 10 + } ); - element.simulate( "drag", { - dx: 10, - dy: 10 + $( window ).off( "mouseup", handler ); } ); - - $( window ).off( "mouseup", handler ); -} ); +} } );