aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKonstantin Dinev <kdinev@mail.bw.edu>2017-02-24 17:36:19 +0200
committerScott González <scott.gonzalez@gmail.com>2017-02-24 14:30:58 -0500
commit278d1e1108e6c12d35be9edce2a9efcab1946229 (patch)
tree0913b92629f624f69fb1507ba6a936f81fbefea9 /tests
parenta3b9129be19afabb3fa6b2fb913b85aab43f4652 (diff)
downloadjquery-ui-278d1e1108e6c12d35be9edce2a9efcab1946229.tar.gz
jquery-ui-278d1e1108e6c12d35be9edce2a9efcab1946229.zip
Resizable: Keep user defined handles on _setOption
Fixes #15084 Closes gh-1795
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/resizable/options.js28
1 files changed, 20 insertions, 8 deletions
diff --git a/tests/unit/resizable/options.js b/tests/unit/resizable/options.js
index f89682593..4080bac0e 100644
--- a/tests/unit/resizable/options.js
+++ b/tests/unit/resizable/options.js
@@ -434,11 +434,20 @@ QUnit.test( "zIndex, applied to all handles", function( assert ) {
} );
QUnit.test( "setOption handles", function( assert ) {
- assert.expect( 11 );
-
- var target = $( "<div></div>" ).resizable();
-
- function checkHandles( expectedHandles ) {
+ assert.expect( 15 );
+
+ var target = $( "<div></div>" ).resizable(),
+ target2 = $( "<div>" +
+ "<div class='ui-resizable-handle ui-resizable-e'></div>" +
+ "<div class='ui-resizable-handle ui-resizable-w'></div>" +
+ "</div>" ).resizable( {
+ handles: {
+ "e": "ui-resizable-e",
+ "w": "ui-resizable-w"
+ }
+ } );
+
+ function checkHandles( target, expectedHandles ) {
expectedHandles = $.map( expectedHandles, function( value ) {
return ".ui-resizable-" + value;
} );
@@ -451,13 +460,16 @@ QUnit.test( "setOption handles", function( assert ) {
} );
}
- checkHandles( [ "e", "s", "se" ] );
+ checkHandles( target, [ "e", "s", "se" ] );
target.resizable( "option", "handles", "n, w, nw" );
- checkHandles( [ "n", "w", "nw" ] );
+ checkHandles( target, [ "n", "w", "nw" ] );
target.resizable( "option", "handles", "s, w" );
- checkHandles( [ "s", "w" ] );
+ checkHandles( target, [ "s", "w" ] );
+
+ target2.resizable( "option", "handles", "e, s, w" );
+ checkHandles( target2, [ "e", "s", "w" ] );
} );
QUnit.test( "alsoResize + containment", function( assert ) {