diff options
author | Thomas Park <thomas@thomaspark.me> | 2013-08-16 16:26:07 -0700 |
---|---|---|
committer | Thomas Park <thomas@thomaspark.me> | 2013-08-16 16:26:07 -0700 |
commit | 4fe37339653c909368ba772ea9214c0b2a511fee (patch) | |
tree | 7573a3ef5486c1397e3f267f856de0fb3a031177 /bower_components/bootstrap/js/tests | |
parent | f9b56d31da29a641fcfdc33825ac84422eea2b84 (diff) |
update bootstrap to 3.0.0-rc2
Diffstat (limited to 'bower_components/bootstrap/js/tests')
19 files changed, 202 insertions, 146 deletions
diff --git a/bower_components/bootstrap/js/tests/index.html b/bower_components/bootstrap/js/tests/index.html index 501bf38f..501bf38f 100644..100755 --- a/bower_components/bootstrap/js/tests/index.html +++ b/bower_components/bootstrap/js/tests/index.html diff --git a/bower_components/bootstrap/js/tests/phantom.js b/bower_components/bootstrap/js/tests/phantom.js index a9047db4..a9047db4 100644..100755 --- a/bower_components/bootstrap/js/tests/phantom.js +++ b/bower_components/bootstrap/js/tests/phantom.js diff --git a/bower_components/bootstrap/js/tests/server.js b/bower_components/bootstrap/js/tests/server.js index f0def8f3..f0def8f3 100644..100755 --- a/bower_components/bootstrap/js/tests/server.js +++ b/bower_components/bootstrap/js/tests/server.js diff --git a/bower_components/bootstrap/js/tests/unit/affix.js b/bower_components/bootstrap/js/tests/unit/affix.js index b74bc51e..b74bc51e 100644..100755 --- a/bower_components/bootstrap/js/tests/unit/affix.js +++ b/bower_components/bootstrap/js/tests/unit/affix.js diff --git a/bower_components/bootstrap/js/tests/unit/alert.js b/bower_components/bootstrap/js/tests/unit/alert.js index 98b10059..98b10059 100644..100755 --- a/bower_components/bootstrap/js/tests/unit/alert.js +++ b/bower_components/bootstrap/js/tests/unit/alert.js diff --git a/bower_components/bootstrap/js/tests/unit/button.js b/bower_components/bootstrap/js/tests/unit/button.js index 41ddb5c2..41ddb5c2 100644..100755 --- a/bower_components/bootstrap/js/tests/unit/button.js +++ b/bower_components/bootstrap/js/tests/unit/button.js diff --git a/bower_components/bootstrap/js/tests/unit/carousel.js b/bower_components/bootstrap/js/tests/unit/carousel.js index badf0886..badf0886 100644..100755 --- a/bower_components/bootstrap/js/tests/unit/carousel.js +++ b/bower_components/bootstrap/js/tests/unit/carousel.js diff --git a/bower_components/bootstrap/js/tests/unit/collapse.js b/bower_components/bootstrap/js/tests/unit/collapse.js index 73799c75..11b2cf83 100644..100755 --- a/bower_components/bootstrap/js/tests/unit/collapse.js +++ b/bower_components/bootstrap/js/tests/unit/collapse.js @@ -126,4 +126,39 @@ $(function () { target3.click() }) + test("should allow dots in data-parent", function () { + $.support.transition = false + stop() + + var accordion = $('<div class="accordion"><div class="accordion-group"></div><div class="accordion-group"></div><div class="accordion-group"></div></div>') + .appendTo($('#qunit-fixture')) + + var target1 = $('<a data-toggle="collapse" href="#body1" data-parent=".accordion"></a>') + .appendTo(accordion.find('.accordion-group').eq(0)) + + var collapsible1 = $('<div id="body1" class="in"></div>') + .appendTo(accordion.find('.accordion-group').eq(0)) + + var target2 = $('<a class="collapsed" data-toggle="collapse" href="#body2" data-parent=".accordion"></a>') + .appendTo(accordion.find('.accordion-group').eq(1)) + + var collapsible2 = $('<div id="body2"></div>') + .appendTo(accordion.find('.accordion-group').eq(1)) + + var target3 = $('<a class="collapsed" data-toggle="collapse" href="#body3" data-parent=".accordion"></a>') + .appendTo(accordion.find('.accordion-group').eq(2)) + + var collapsible3 = $('<div id="body3"></div>') + .appendTo(accordion.find('.accordion-group').eq(2)) + .on('show.bs.collapse', function () { + ok(target1.hasClass('collapsed')) + ok(target2.hasClass('collapsed')) + ok(!target3.hasClass('collapsed')) + + start() + }) + + target3.click() + }) + }) diff --git a/bower_components/bootstrap/js/tests/unit/dropdown.js b/bower_components/bootstrap/js/tests/unit/dropdown.js index e45bd0a4..02256965 100644..100755 --- a/bower_components/bootstrap/js/tests/unit/dropdown.js +++ b/bower_components/bootstrap/js/tests/unit/dropdown.js @@ -165,9 +165,9 @@ $(function () { .appendTo('#qunit-fixture') .find('[data-toggle="dropdown"]') .dropdown() - + stop() - + dropdown .parent('.dropdown') .bind('show.bs.dropdown', function () { @@ -177,7 +177,7 @@ $(function () { ok(true, 'hide was called') start() }) - + dropdown.click() $(document.body).click() }) @@ -199,9 +199,9 @@ $(function () { .appendTo('#qunit-fixture') .find('[data-toggle="dropdown"]') .dropdown() - + stop() - + dropdown .parent('.dropdown') .bind('shown.bs.dropdown', function () { @@ -211,7 +211,7 @@ $(function () { ok(true, 'hide was called') start() }) - + dropdown.click() $(document.body).click() }) diff --git a/bower_components/bootstrap/js/tests/unit/modal.js b/bower_components/bootstrap/js/tests/unit/modal.js index 90762ea9..2c610d83 100644..100755 --- a/bower_components/bootstrap/js/tests/unit/modal.js +++ b/bower_components/bootstrap/js/tests/unit/modal.js @@ -1,156 +1,177 @@ $(function () { - module("modal") + module("modal") - test("should provide no conflict", function () { - var modal = $.fn.modal.noConflict() - ok(!$.fn.modal, 'modal was set back to undefined (org value)') - $.fn.modal = modal - }) + test("should provide no conflict", function () { + var modal = $.fn.modal.noConflict() + ok(!$.fn.modal, 'modal was set back to undefined (org value)') + $.fn.modal = modal + }) - test("should be defined on jquery object", function () { - var div = $("<div id='modal-test'></div>") - ok(div.modal, 'modal method is defined') - }) + test("should be defined on jquery object", function () { + var div = $("<div id='modal-test'></div>") + ok(div.modal, 'modal method is defined') + }) - test("should return element", function () { - var div = $("<div id='modal-test'></div>") - ok(div.modal() == div, 'document.body returned') - $('#modal-test').remove() - }) + test("should return element", function () { + var div = $("<div id='modal-test'></div>") + ok(div.modal() == div, 'document.body returned') + $('#modal-test').remove() + }) - test("should expose defaults var for settings", function () { - ok($.fn.modal.Constructor.DEFAULTS, 'default object exposed') - }) + test("should expose defaults var for settings", function () { + ok($.fn.modal.Constructor.DEFAULTS, 'default object exposed') + }) - test("should insert into dom when show method is called", function () { - stop() - $.support.transition = false - $("<div id='modal-test'></div>") - .on("shown.bs.modal", function () { - ok($('#modal-test').length, 'modal inserted into dom') - $(this).remove() - start() - }) - .modal("show") - }) + test("should insert into dom when show method is called", function () { + stop() + $.support.transition = false + $("<div id='modal-test'></div>") + .on("shown.bs.modal", function () { + ok($('#modal-test').length, 'modal inserted into dom') + $(this).remove() + start() + }) + .modal("show") + }) - test("should fire show event", function () { - stop() - $.support.transition = false - $("<div id='modal-test'></div>") - .on("show.bs.modal", function () { - ok(true, "show was called") - }) - .on("shown.bs.modal", function () { - $(this).remove() - start() - }) - .modal("show") - }) + test("should fire show event", function () { + stop() + $.support.transition = false + $("<div id='modal-test'></div>") + .on("show.bs.modal", function () { + ok(true, "show was called") + }) + .on("shown.bs.modal", function () { + $(this).remove() + start() + }) + .modal("show") + }) - test("should not fire shown when default prevented", function () { - stop() - $.support.transition = false - $("<div id='modal-test'></div>") - .on("show.bs.modal", function (e) { - e.preventDefault() - ok(true, "show was called") - start() - }) - .on("shown.bs.modal", function () { - ok(false, "shown was called") - }) - .modal("show") - }) + test("should not fire shown when default prevented", function () { + stop() + $.support.transition = false + $("<div id='modal-test'></div>") + .on("show.bs.modal", function (e) { + e.preventDefault() + ok(true, "show was called") + start() + }) + .on("shown.bs.modal", function () { + ok(false, "shown was called") + }) + .modal("show") + }) - test("should hide modal when hide is called", function () { - stop() - $.support.transition = false + test("should hide modal when hide is called", function () { + stop() + $.support.transition = false - $("<div id='modal-test'></div>") - .on("shown.bs.modal", function () { - ok($('#modal-test').is(":visible"), 'modal visible') - ok($('#modal-test').length, 'modal inserted into dom') - $(this).modal("hide") - }) - .on("hidden.bs.modal", function() { - ok(!$('#modal-test').is(":visible"), 'modal hidden') - $('#modal-test').remove() - start() - }) - .modal("show") - }) + $("<div id='modal-test'></div>") + .on("shown.bs.modal", function () { + ok($('#modal-test').is(":visible"), 'modal visible') + ok($('#modal-test').length, 'modal inserted into dom') + $(this).modal("hide") + }) + .on("hidden.bs.modal", function() { + ok(!$('#modal-test').is(":visible"), 'modal hidden') + $('#modal-test').remove() + start() + }) + .modal("show") + }) - test("should toggle when toggle is called", function () { - stop() - $.support.transition = false - var div = $("<div id='modal-test'></div>") - div - .on("shown.bs.modal", function () { - ok($('#modal-test').is(":visible"), 'modal visible') - ok($('#modal-test').length, 'modal inserted into dom') - div.modal("toggle") - }) - .on("hidden.bs.modal", function() { - ok(!$('#modal-test').is(":visible"), 'modal hidden') - div.remove() - start() - }) - .modal("toggle") - }) + test("should toggle when toggle is called", function () { + stop() + $.support.transition = false + var div = $("<div id='modal-test'></div>") + div + .on("shown.bs.modal", function () { + ok($('#modal-test').is(":visible"), 'modal visible') + ok($('#modal-test').length, 'modal inserted into dom') + div.modal("toggle") + }) + .on("hidden.bs.modal", function() { + ok(!$('#modal-test').is(":visible"), 'modal hidden') + div.remove() + start() + }) + .modal("toggle") + }) - test("should remove from dom when click [data-dismiss=modal]", function () { - stop() - $.support.transition = false - var div = $("<div id='modal-test'><span class='close' data-dismiss='modal'></span></div>") - div - .on("shown.bs.modal", function () { - ok($('#modal-test').is(":visible"), 'modal visible') - ok($('#modal-test').length, 'modal inserted into dom') - div.find('.close').click() - }) - .on("hidden.bs.modal", function() { - ok(!$('#modal-test').is(":visible"), 'modal hidden') - div.remove() - start() - }) - .modal("toggle") - }) + test("should remove from dom when click [data-dismiss=modal]", function () { + stop() + $.support.transition = false + var div = $("<div id='modal-test'><span class='close' data-dismiss='modal'></span></div>") + div + .on("shown.bs.modal", function () { + ok($('#modal-test').is(":visible"), 'modal visible') + ok($('#modal-test').length, 'modal inserted into dom') + div.find('.close').click() + }) + .on("hidden.bs.modal", function() { + ok(!$('#modal-test').is(":visible"), 'modal hidden') + div.remove() + start() + }) + .modal("toggle") + }) - test("should allow modal close with 'backdrop:false'", function () { - stop() - $.support.transition = false - var div = $("<div>", { id: 'modal-test', "data-backdrop": false }) - div - .on("shown.bs.modal", function () { - ok($('#modal-test').is(":visible"), 'modal visible') - div.modal("hide") - }) - .on("hidden.bs.modal", function() { - ok(!$('#modal-test').is(":visible"), 'modal hidden') - div.remove() - start() - }) - .modal("show") - }) + test("should allow modal close with 'backdrop:false'", function () { + stop() + $.support.transition = false + var div = $("<div>", { id: 'modal-test', "data-backdrop": false }) + div + .on("shown.bs.modal", function () { + ok($('#modal-test').is(":visible"), 'modal visible') + div.modal("hide") + }) + .on("hidden.bs.modal", function() { + ok(!$('#modal-test').is(":visible"), 'modal hidden') + div.remove() + start() + }) + .modal("show") + }) - test("should close modal when clicking outside of modal-content", function () { - stop() - $.support.transition = false - var div = $("<div id='modal-test'><div class='contents'></div></div>") - div - .bind("shown.bs.modal", function () { - ok($('#modal-test').length, 'modal insterted into dom') - $('.contents').click() - ok($('#modal-test').is(":visible"), 'modal visible') - $('#modal-test').click() - }) - .bind("hidden.bs.modal", function() { - ok(!$('#modal-test').is(":visible"), 'modal hidden') - div.remove() - start() - }) - .modal("show") - }) + test("should close modal when clicking outside of modal-content", function () { + stop() + $.support.transition = false + var div = $("<div id='modal-test'><div class='contents'></div></div>") + div + .bind("shown.bs.modal", function () { + ok($('#modal-test').length, 'modal insterted into dom') + $('.contents').click() + ok($('#modal-test').is(":visible"), 'modal visible') + $('#modal-test').click() + }) + .bind("hidden.bs.modal", function() { + ok(!$('#modal-test').is(":visible"), 'modal hidden') + div.remove() + start() + }) + .modal("show") + }) + + test("should trigger hide event once when clicking outside of modal-content", function () { + stop() + $.support.transition = false + var div = $("<div id='modal-test'><div class='contents'></div></div>") + var triggered + div + .bind("shown.bs.modal", function () { + triggered = 0 + $('#modal-test').click() + }) + .one("hidden.bs.modal", function() { + div.modal("show") + }) + .bind("hide.bs.modal", function () { + triggered += 1 + ok(triggered === 1, 'modal hide triggered once') + start() + }) + .modal("show") + }) }) diff --git a/bower_components/bootstrap/js/tests/unit/phantom.js b/bower_components/bootstrap/js/tests/unit/phantom.js index c584c5a3..c584c5a3 100644..100755 --- a/bower_components/bootstrap/js/tests/unit/phantom.js +++ b/bower_components/bootstrap/js/tests/unit/phantom.js diff --git a/bower_components/bootstrap/js/tests/unit/popover.js b/bower_components/bootstrap/js/tests/unit/popover.js index 767d7986..767d7986 100644..100755 --- a/bower_components/bootstrap/js/tests/unit/popover.js +++ b/bower_components/bootstrap/js/tests/unit/popover.js diff --git a/bower_components/bootstrap/js/tests/unit/scrollspy.js b/bower_components/bootstrap/js/tests/unit/scrollspy.js index 06219a1c..06219a1c 100644..100755 --- a/bower_components/bootstrap/js/tests/unit/scrollspy.js +++ b/bower_components/bootstrap/js/tests/unit/scrollspy.js diff --git a/bower_components/bootstrap/js/tests/unit/tab.js b/bower_components/bootstrap/js/tests/unit/tab.js index aede32ab..aede32ab 100644..100755 --- a/bower_components/bootstrap/js/tests/unit/tab.js +++ b/bower_components/bootstrap/js/tests/unit/tab.js diff --git a/bower_components/bootstrap/js/tests/unit/tooltip.js b/bower_components/bootstrap/js/tests/unit/tooltip.js index ed1bf54b..ed1bf54b 100644..100755 --- a/bower_components/bootstrap/js/tests/unit/tooltip.js +++ b/bower_components/bootstrap/js/tests/unit/tooltip.js diff --git a/bower_components/bootstrap/js/tests/unit/transition.js b/bower_components/bootstrap/js/tests/unit/transition.js index 39c415bc..39c415bc 100644..100755 --- a/bower_components/bootstrap/js/tests/unit/transition.js +++ b/bower_components/bootstrap/js/tests/unit/transition.js diff --git a/bower_components/bootstrap/js/tests/vendor/jquery.js b/bower_components/bootstrap/js/tests/vendor/jquery.js index 32d50cb0..32d50cb0 100644..100755 --- a/bower_components/bootstrap/js/tests/vendor/jquery.js +++ b/bower_components/bootstrap/js/tests/vendor/jquery.js diff --git a/bower_components/bootstrap/js/tests/vendor/qunit.css b/bower_components/bootstrap/js/tests/vendor/qunit.css index aa0445dd..aa0445dd 100644..100755 --- a/bower_components/bootstrap/js/tests/vendor/qunit.css +++ b/bower_components/bootstrap/js/tests/vendor/qunit.css diff --git a/bower_components/bootstrap/js/tests/vendor/qunit.js b/bower_components/bootstrap/js/tests/vendor/qunit.js index b332d705..b332d705 100644..100755 --- a/bower_components/bootstrap/js/tests/vendor/qunit.js +++ b/bower_components/bootstrap/js/tests/vendor/qunit.js |