diff options
author | Felix Nagel <info@felixnagel.com> | 2013-05-30 21:28:15 +0200 |
---|---|---|
committer | Felix Nagel <info@felixnagel.com> | 2013-05-30 21:28:15 +0200 |
commit | 57fa48281c0e04c4696e9ad8c2d24397b55391de (patch) | |
tree | 4f140670b60f227cefc1a191631c1b3cfcb48fea /tests | |
parent | bfd3c4aace6810672f4ae56ae783faf5bfbca17f (diff) | |
parent | 699756942f5c8201a529295fde0e7f358ba48317 (diff) | |
download | jquery-ui-57fa48281c0e04c4696e9ad8c2d24397b55391de.tar.gz jquery-ui-57fa48281c0e04c4696e9ad8c2d24397b55391de.zip |
Merge branch 'master' into selectmenu
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/autocomplete/autocomplete_core.js | 28 | ||||
-rw-r--r-- | tests/unit/resizable/resizable_events.js | 47 |
2 files changed, 75 insertions, 0 deletions
diff --git a/tests/unit/autocomplete/autocomplete_core.js b/tests/unit/autocomplete/autocomplete_core.js index df98725ee..03ebdfec9 100644 --- a/tests/unit/autocomplete/autocomplete_core.js +++ b/tests/unit/autocomplete/autocomplete_core.js @@ -192,6 +192,34 @@ asyncTest( "handle race condition", function() { } }); +asyncTest( "simultaneous searches (#9334)", function() { + expect( 2 ); + var element = $( "#autocomplete" ).autocomplete({ + source: function( request, response ) { + setTimeout(function() { + response([ request.term ]); + }); + }, + response: function() { + ok( true, "response from first instance" ); + } + }), + element2 = $( "#autocomplete-textarea" ).autocomplete({ + source: function( request, response ) { + setTimeout(function() { + response([ request.term ]); + }); + }, + response: function() { + ok( true, "response from second instance" ); + start(); + } + }); + + element.autocomplete( "search", "test" ); + element2.autocomplete( "search", "test" ); +}); + test( "ARIA", function() { expect( 7 ); var element = $( "#autocomplete" ).autocomplete({ diff --git a/tests/unit/resizable/resizable_events.js b/tests/unit/resizable/resizable_events.js index ac222ec10..18e25bfdf 100644 --- a/tests/unit/resizable/resizable_events.js +++ b/tests/unit/resizable/resizable_events.js @@ -170,4 +170,51 @@ test("stop", function() { }); +test( "resize (containment) works with parent with negative offset", function() { + + expect( 1 ); + + var widthBefore, widthAfter, + handle = ".ui-resizable-e", + target = $( "#resizable1" ), + absoluteContainer = target.wrap( "<div />" ).parent(), + fixedContainer = absoluteContainer.wrap( "<div />" ).parent(), + increaseWidthBy = 50; + + // position fixed container in window top left + fixedContainer.css({ + width: 400, + height: 100, + position: "fixed", + top: 0, + left: 0 + }); + + // position absolute container within fixed on slightly outside window + absoluteContainer.css({ + width: 400, + height: 100, + position: "absolute", + top: 0, + left: -50 + }); + + // set up resizable to be contained within absolute container + target.resizable({ + handles: "all", + containment: "parent" + }).css({ + width: 300 + }); + + widthBefore = target.width(); + + TestHelpers.resizable.drag( handle, increaseWidthBy, 0 ); + + widthAfter = target.width(); + + equal( widthAfter, ( widthBefore + increaseWidthBy ), "resizable width should be increased by the value dragged" ); + +}); + })(jQuery); |