summaryrefslogtreecommitdiffstats
path: root/apps/it/static/js/ui/tests/unit/selectable
diff options
context:
space:
mode:
authorFilipp Lepalaan <f@230.to>2014-02-20 12:44:49 +0200
committerFilipp Lepalaan <f@230.to>2014-02-20 12:44:49 +0200
commit3321241b61766045a68a3d607b67e11a95014e87 (patch)
treed13ce50a7c46f986f403733e9922e766665e7d2b /apps/it/static/js/ui/tests/unit/selectable
parent75ad7e4bd7d69243e7e5281c2642f00478fb072d (diff)
downloadpudding-3321241b61766045a68a3d607b67e11a95014e87.tar.gz
pudding-3321241b61766045a68a3d607b67e11a95014e87.tar.bz2
pudding-3321241b61766045a68a3d607b67e11a95014e87.zip
Require logins, removed jquery UI
Diffstat (limited to 'apps/it/static/js/ui/tests/unit/selectable')
-rw-r--r--apps/it/static/js/ui/tests/unit/selectable/all.html30
-rw-r--r--apps/it/static/js/ui/tests/unit/selectable/selectable.html51
-rw-r--r--apps/it/static/js/ui/tests/unit/selectable/selectable_common.js21
-rw-r--r--apps/it/static/js/ui/tests/unit/selectable/selectable_core.js3
-rw-r--r--apps/it/static/js/ui/tests/unit/selectable/selectable_events.js69
-rw-r--r--apps/it/static/js/ui/tests/unit/selectable/selectable_methods.js104
-rw-r--r--apps/it/static/js/ui/tests/unit/selectable/selectable_options.js65
7 files changed, 0 insertions, 343 deletions
diff --git a/apps/it/static/js/ui/tests/unit/selectable/all.html b/apps/it/static/js/ui/tests/unit/selectable/all.html
deleted file mode 100644
index 5ee323f..0000000
--- a/apps/it/static/js/ui/tests/unit/selectable/all.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <title>jQuery UI Selectable Test Suite</title>
-
- <script src="../../../jquery-1.10.2.js"></script>
-
- <link rel="stylesheet" href="../../../external/qunit.css">
- <link rel="stylesheet" href="../qunit-composite.css">
- <script src="../../../external/qunit.js"></script>
- <script src="../qunit-composite.js"></script>
- <script src="../subsuite.js"></script>
-
- <script>
- testAllVersions( "selectable" );
- </script>
-</head>
-<body>
-
-<h1 id="qunit-header">jQuery UI Selectable Test Suite</h1>
-<h2 id="qunit-banner"></h2>
-<div id="qunit-testrunner-toolbar"></div>
-<h2 id="qunit-userAgent"></h2>
-<ol id="qunit-tests"></ol>
-<div id="qunit-fixture">
-
-</div>
-</body>
-</html>
diff --git a/apps/it/static/js/ui/tests/unit/selectable/selectable.html b/apps/it/static/js/ui/tests/unit/selectable/selectable.html
deleted file mode 100644
index 18ffc6e..0000000
--- a/apps/it/static/js/ui/tests/unit/selectable/selectable.html
+++ /dev/null
@@ -1,51 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <title>jQuery UI Selectable Test Suite</title>
-
- <script src="../../jquery.js"></script>
- <link rel="stylesheet" href="../../../external/qunit.css">
- <script src="../../../external/qunit.js"></script>
- <script src="../../jquery.simulate.js"></script>
- <script src="../testsuite.js"></script>
- <script>
- TestHelpers.loadResources({
- css: [ "ui.core", "ui.selectable" ],
- js: [
- "ui/jquery.ui.core.js",
- "ui/jquery.ui.widget.js",
- "ui/jquery.ui.mouse.js",
- "ui/jquery.ui.selectable.js"
- ]
- });
- </script>
-
- <script src="selectable_common.js"></script>
- <script src="selectable_core.js"></script>
- <script src="selectable_events.js"></script>
- <script src="selectable_methods.js"></script>
- <script src="selectable_options.js"></script>
-
- <script src="../swarminject.js"></script>
-</head>
-<body>
-
-<h1 id="qunit-header">jQuery UI Selectable Test Suite</h1>
-<h2 id="qunit-banner"></h2>
-<div id="qunit-testrunner-toolbar"></div>
-<h2 id="qunit-userAgent"></h2>
-<ol id="qunit-tests"></ol>
-<div id="qunit-fixture">
-
-<ul id="selectable1">
- <li>Item 1</li>
- <li>Item 2</li>
- <li class="special">Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
-</ul>
-
-</div>
-</body>
-</html>
diff --git a/apps/it/static/js/ui/tests/unit/selectable/selectable_common.js b/apps/it/static/js/ui/tests/unit/selectable/selectable_common.js
deleted file mode 100644
index d00a47b..0000000
--- a/apps/it/static/js/ui/tests/unit/selectable/selectable_common.js
+++ /dev/null
@@ -1,21 +0,0 @@
-TestHelpers.commonWidgetTests("selectable", {
- defaults: {
- appendTo: "body",
- autoRefresh: true,
- cancel: "input,textarea,button,select,option",
- delay: 0,
- disabled: false,
- distance: 0,
- filter: "*",
- tolerance: "touch",
-
- // callbacks
- create: null,
- selected: null,
- selecting: null,
- start: null,
- stop: null,
- unselected: null,
- unselecting: null
- }
-});
diff --git a/apps/it/static/js/ui/tests/unit/selectable/selectable_core.js b/apps/it/static/js/ui/tests/unit/selectable/selectable_core.js
deleted file mode 100644
index 9953b6c..0000000
--- a/apps/it/static/js/ui/tests/unit/selectable/selectable_core.js
+++ /dev/null
@@ -1,3 +0,0 @@
-/*
- * selectable_core.js
- */ \ No newline at end of file
diff --git a/apps/it/static/js/ui/tests/unit/selectable/selectable_events.js b/apps/it/static/js/ui/tests/unit/selectable/selectable_events.js
deleted file mode 100644
index ae35fa3..0000000
--- a/apps/it/static/js/ui/tests/unit/selectable/selectable_events.js
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * selectable_events.js
- */
-(function( $ ) {
-
-module("selectable: events");
-
-test( "start", function() {
- expect( 2 );
- var el = $("#selectable1");
- el.selectable({
- start: function() {
- ok( true, "drag fired start callback" );
- equal( this, el[0], "context of callback" );
- }
- });
- el.simulate( "drag", {
- dx: 20,
- dy: 20
- });
-});
-
-test( "stop", function() {
- expect( 2 );
- var el = $("#selectable1");
- el.selectable({
- start: function() {
- ok( true, "drag fired stop callback" );
- equal( this, el[0], "context of callback" );
- }
- });
- el.simulate( "drag", {
- dx: 20,
- dy: 20
- });
-});
-
-test( "mousedown: initial position of helper", function() {
- expect( 2 );
-
- var helperOffset,
- element = $( "#selectable1" ).selectable(),
- contentToForceScroll = $( "<div>" ).css({
- height: "10000px",
- width: "10000px"
- });
-
- contentToForceScroll.appendTo( "body" );
- $( window ).scrollTop( 100 ).scrollLeft( 100 );
-
- element.simulate( "mousedown", {
- clientX: 10,
- clientY: 10
- });
-
- // we do a GTE comparison here because IE7 erroneously subtracts
- // 2 pixels from a simulated mousedown for clientX/Y
- // Support: IE7
- helperOffset = $( ".ui-selectable-helper" ).offset();
- ok( helperOffset.top >= 99, "Scroll top should be accounted for." );
- ok( helperOffset.left >= 99, "Scroll left should be accounted for." );
-
- // Cleanup
- element.simulate( "mouseup" );
- contentToForceScroll.remove();
- $( window ).scrollTop( 0 ).scrollLeft( 0 );
-});
-
-})( jQuery );
diff --git a/apps/it/static/js/ui/tests/unit/selectable/selectable_methods.js b/apps/it/static/js/ui/tests/unit/selectable/selectable_methods.js
deleted file mode 100644
index 72f9bb2..0000000
--- a/apps/it/static/js/ui/tests/unit/selectable/selectable_methods.js
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * selectable_methods.js
- */
-(function($) {
-
-module("selectable: methods");
-
-test("init", function() {
- expect( 5 );
-
- $("<div></div>").appendTo("body").selectable().remove();
- ok(true, ".selectable() called on element");
-
- $([]).selectable().remove();
- ok(true, ".selectable() called on empty collection");
-
- $("<div></div>").selectable().remove();
- ok(true, ".selectable() called on disconnected DOMElement");
-
- var el = $("<div></div>").selectable();
- el.selectable("option", "foo");
- el.remove();
- ok(true, "arbitrary option getter after init");
-
- $("<div></div>").selectable().selectable("option", "foo", "bar").remove();
- ok(true, "arbitrary option setter after init");
-});
-
-test("destroy", function() {
- expect( 4 );
-
- $("<div></div>").appendTo("body").selectable().selectable("destroy").remove();
- ok(true, ".selectable('destroy') called on element");
-
- $([]).selectable().selectable("destroy").remove();
- ok(true, ".selectable('destroy') called on empty collection");
-
- $("<div></div>").selectable().selectable("destroy").remove();
- ok(true, ".selectable('destroy') called on disconnected DOMElement");
-
- var expected = $("<div></div>").selectable(),
- actual = expected.selectable("destroy");
- equal(actual, expected, "destroy is chainable");
-});
-
-test("enable", function() {
- expect(3);
- var expected, actual,
- fired = false,
- el = $("#selectable1");
-
- el.selectable({
- disabled: true,
- start: function() { fired = true; }
- });
- el.simulate( "drag", {
- dx: 20,
- dy: 20
- });
- equal(fired, false, "start fired");
- el.selectable("enable");
- el.simulate( "drag", {
- dx: 20,
- dy: 20
- });
- equal(fired, true, "start fired");
- el.selectable("destroy");
-
- expected = $("<div></div>").selectable();
- actual = expected.selectable("enable");
- equal(actual, expected, "enable is chainable");
-});
-
-test("disable", function() {
- expect(3);
- var expected, actual,
- fired = false,
- el = $("#selectable1");
-
- el.selectable({
- disabled: false,
- start: function() { fired = true; }
- });
- el.simulate( "drag", {
- dx: 20,
- dy: 20
- });
- equal(fired, true, "start fired");
- el.selectable("disable");
- fired = false;
-
- el.simulate( "drag", {
- dx: 20,
- dy: 20
- });
- equal(fired, false, "start fired");
- el.selectable("destroy");
-
- expected = $("<div></div>").selectable();
- actual = expected.selectable("disable");
- equal(actual, expected, "disable is chainable");
-});
-
-})(jQuery);
diff --git a/apps/it/static/js/ui/tests/unit/selectable/selectable_options.js b/apps/it/static/js/ui/tests/unit/selectable/selectable_options.js
deleted file mode 100644
index 973247f..0000000
--- a/apps/it/static/js/ui/tests/unit/selectable/selectable_options.js
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * selectable_options.js
- */
-(function($) {
-
-module("selectable: options");
-
-test("autoRefresh", function() {
- expect(3);
-
- var actual = 0,
- el = $("#selectable1"),
- sel = $("*", el),
- selected = function() { actual += 1; };
-
- el = $("#selectable1").selectable({ autoRefresh: false, selected: selected });
- sel.hide();
- el.simulate( "drag", {
- dx: 1000,
- dy: 1000
- });
- equal(actual, sel.length);
- el.selectable("destroy");
-
- actual = 0;
- sel.show();
- el = $("#selectable1").selectable({ autoRefresh: true, selected: selected });
- sel.hide();
- el.simulate( "drag", {
- dx: 1000,
- dy: 1000
- });
- equal(actual, 0);
-
- sel.show();
- $( sel[ 0 ] ).simulate( "drag", {
- dx: 1000,
- dy: 1000
- });
- equal(actual, sel.length);
-
- el.selectable("destroy");
- sel.show();
-});
-
-test("filter", function() {
- expect(2);
-
- var actual =0,
- el = $("#selectable1"),
- sel = $("*", el),
- selected = function() { actual += 1; };
-
-
- el = $("#selectable1").selectable({ filter: ".special", selected: selected });
- el.simulate( "drag", {
- dx: 1000,
- dy: 1000
- });
- ok(sel.length !== 1, "this test assumes more than 1 selectee");
- equal(actual, 1);
- el.selectable("destroy");
-});
-
-})(jQuery);