From afb7bab90f5eeef1a1f086d04b8dffa70d878c88 Mon Sep 17 00:00:00 2001 From: "jblas@adobe.com" Date: Tue, 15 Nov 2011 10:22:36 -0800 Subject: [PATCH] Test case for issues: 3046 - closestEnabledButton() conflicts with OpenLayers 3054 - RC3 - button conflicts with svg element, throws error: Uncaught TypeError: Object # has no method 'split' --- tests/unit/buttonMarkup/buttonMarkup_core.js | 18 ++++++++++++++++++ tests/unit/buttonMarkup/index.html | 3 +++ 2 files changed, 21 insertions(+) diff --git a/tests/unit/buttonMarkup/buttonMarkup_core.js b/tests/unit/buttonMarkup/buttonMarkup_core.js index ae135832..53cb0532 100644 --- a/tests/unit/buttonMarkup/buttonMarkup_core.js +++ b/tests/unit/buttonMarkup/buttonMarkup_core.js @@ -26,4 +26,22 @@ ok(!group.find('[data-iconshadow=false] .ui-icon').hasClass("ui-icon-shadow"), "buttons with data-iconshadow=false should not have the ui-icon-shadow class on their icons"); }); + + // Test for issue #3046 and #3054: + test( "mousedown on SVG elements should not throw an exception", function(){ + var svg = $("#embedded-svg"), + success = true, + rect; + ok(svg.length > 0, "found embedded svg document" ); + if ( svg.length > 0 ) { + rect = $( "rect", svg ); + ok(rect.length > 0, "found rect" ); + try { + rect.trigger("mousedown"); + } catch ( ex ) { + success = false; + } + ok( success, "mousedown executed without exception"); + } + }); })(jQuery); diff --git a/tests/unit/buttonMarkup/index.html b/tests/unit/buttonMarkup/index.html index 57bbb378..94bb9391 100644 --- a/tests/unit/buttonMarkup/index.html +++ b/tests/unit/buttonMarkup/index.html @@ -30,6 +30,9 @@ No shadow or corners No iconshadow + + +