From 3909e6d89e01e4cd8777377c63037896bb95aa2f Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Fri, 25 Nov 2011 21:18:19 +0100 Subject: new jq layout --- .../jquery-ui-1.9pre/tests/unit/droppable/all.html | 30 ++++++++ .../tests/unit/droppable/droppable.html | 60 +++++++++++++++ .../tests/unit/droppable/droppable_core.js | 36 +++++++++ .../tests/unit/droppable/droppable_defaults.js | 16 ++++ .../tests/unit/droppable/droppable_events.js | 28 +++++++ .../tests/unit/droppable/droppable_methods.js | 86 ++++++++++++++++++++++ .../tests/unit/droppable/droppable_options.js | 68 +++++++++++++++++ 7 files changed, 324 insertions(+) create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/all.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_core.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_defaults.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_events.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_methods.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_options.js (limited to 'src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable') diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/all.html new file mode 100644 index 0000000..e7f274c --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/all.html @@ -0,0 +1,30 @@ + + + + + jQuery UI Droppable Test Suite + + + + + + + + + + + + + +

jQuery UI Droppable Test Suite

+

+
+

+
    +
    + +
    + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable.html new file mode 100644 index 0000000..abf94f0 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable.html @@ -0,0 +1,60 @@ + + + + + jQuery UI Droppable Test Suite + + + + + + + + + + + + + + + + + + + + + +

    jQuery UI Droppable Test Suite

    +

    +
    +

    +
      +
      + +
      Draggable
      +
      Droppable
      +
       
      + +
      + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_core.js new file mode 100644 index 0000000..4d82017 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_core.js @@ -0,0 +1,36 @@ +/* + * droppable_core.js + */ + +var el, drg; + +function shouldBeDroppable() { + ok(false, 'missing test - untested code is broken code'); +} + +function shouldNotBeDroppable() { + ok(false, 'missing test - untested code is broken code'); +} + +(function($) { + +module("droppable: core"); + +test("element types", function() { + var typeNames = ('p,h1,h2,h3,h4,h5,h6,blockquote,ol,ul,dl,div,form' + + ',table,fieldset,address,ins,del,em,strong,q,cite,dfn,abbr' + + ',acronym,code,samp,kbd,var,img,object,hr' + + ',input,button,label,select,iframe').split(','); + + $.each(typeNames, function(i) { + var typeName = typeNames[i]; + el = $(document.createElement(typeName)).appendTo('body'); + (typeName == 'table' && el.append("content")); + el.droppable(); + shouldBeDroppable(); + el.droppable("destroy"); + el.remove(); + }); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_defaults.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_defaults.js new file mode 100644 index 0000000..7584f5e --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_defaults.js @@ -0,0 +1,16 @@ +/* + * droppable_defaults.js + */ + +var droppable_defaults = { + accept: '*', + activeClass: false, + addClasses: true, + disabled: false, + greedy: false, + hoverClass: false, + scope: "default", + tolerance: "intersect" +}; + +commonWidgetTests('droppable', { defaults: droppable_defaults }); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_events.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_events.js new file mode 100644 index 0000000..f22a035 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_events.js @@ -0,0 +1,28 @@ +/* + * droppable_events.js + */ +(function($) { + +module("droppable: events"); + +test("activate", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +test("deactivate", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +test("over", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +test("out", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +test("drop", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_methods.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_methods.js new file mode 100644 index 0000000..87b9168 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_methods.js @@ -0,0 +1,86 @@ +/* + * droppable_methods.js + */ +(function($) { + +module("droppable: methods"); + +test("init", function() { + expect(6); + + $("
      ").appendTo('body').droppable().remove(); + ok(true, '.droppable() called on element'); + + $([]).droppable(); + ok(true, '.droppable() called on empty collection'); + + $("
      ").droppable(); + ok(true, '.droppable() called on disconnected DOMElement'); + + $("
      ").droppable().droppable("foo"); + ok(true, 'arbitrary method called after init'); + + $("
      ").droppable().droppable("option", "foo"); + ok(true, 'arbitrary option getter after init'); + + $("
      ").droppable().droppable("option", "foo", "bar"); + ok(true, 'arbitrary option setter after init'); +}); + +test("destroy", function() { + $("
      ").appendTo('body').droppable().droppable("destroy").remove(); + ok(true, '.droppable("destroy") called on element'); + + $([]).droppable().droppable("destroy"); + ok(true, '.droppable("destroy") called on empty collection'); + + $("
      ").droppable().droppable("destroy"); + ok(true, '.droppable("destroy") called on disconnected DOMElement'); + + $("
      ").droppable().droppable("destroy").droppable("foo"); + ok(true, 'arbitrary method called after destroy'); + + var expected = $('
      ').droppable(), + actual = expected.droppable('destroy'); + equals(actual, expected, 'destroy is chainable'); +}); + +test("enable", function() { + expect(7); + el = $("#droppable1").droppable({ disabled: true }); + shouldNotBeDroppable(); + el.droppable("enable"); + shouldBeDroppable(); + equals(el.droppable("option", "disabled"), false, "disabled option getter"); + el.droppable("destroy"); + el.droppable({ disabled: true }); + shouldNotBeDroppable(); + el.droppable("option", "disabled", false); + equals(el.droppable("option", "disabled"), false, "disabled option setter"); + shouldBeDroppable(); + + var expected = $('
      ').droppable(), + actual = expected.droppable('enable'); + equals(actual, expected, 'enable is chainable'); +}); + +test("disable", function() { + expect(7); + el = $("#droppable1").droppable({ disabled: false }); + shouldBeDroppable(); + el.droppable("disable"); + shouldNotBeDroppable(); + equals(el.droppable("option", "disabled"), true, "disabled option getter"); + el.droppable("destroy"); + el.droppable({ disabled: false }); + shouldBeDroppable(); + el.droppable("option", "disabled", true); + equals(el.droppable("option", "disabled"), true, "disabled option setter"); + shouldNotBeDroppable(); + + var expected = $('
      ').droppable(), + actual = expected.droppable('disable'); + equals(actual, expected, 'disable is chainable'); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_options.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_options.js new file mode 100644 index 0000000..2f2dbf6 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_options.js @@ -0,0 +1,68 @@ +/* + * droppable_options.js + */ +(function($) { + +module("droppable: options"); + +test("{ accept '*' }, default ", function() { + equals(droppable_defaults.accept, '*'); + + ok(false, 'missing test - untested code is broken code'); +}); + +test("{ accept: Selector }", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +test("{ accept: function(draggable) }", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +test("activeClass", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +test("{ addClasses: true }, default", function() { + equals(droppable_defaults.addClasses, true); + + el = $("
      ").droppable({ addClasses: true }); + ok(el.is(".ui-droppable"), "'ui-droppable' class added"); + el.droppable("destroy"); +}); + +test("{ addClasses: false }", function() { + el = $("
      ").droppable({ addClasses: false }); + ok(!el.is(".ui-droppable"), "'ui-droppable' class not added"); + el.droppable("destroy"); +}); + +test("greedy", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +test("hoverClass", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +test("scope", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +test("tolerance, fit", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +test("tolerance, intersect", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +test("tolerance, pointer", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +test("tolerance, touch", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +})(jQuery); -- cgit v1.1