diff options
author | fat <jacobthornton@gmail.com> | 2014-01-17 01:33:09 +0400 |
---|---|---|
committer | fat <jacobthornton@gmail.com> | 2014-01-17 01:33:09 +0400 |
commit | 2f76821a4dce7683168ab190e53c64fdf13dd469 (patch) | |
tree | 7fb60babcf89856fae934ea30067d13f6e3b1b1f /js/tests/unit | |
parent | bc074d54883de361f98429ab39b004ea89f3557a (diff) |
new qunit
Diffstat (limited to 'js/tests/unit')
-rw-r--r-- | js/tests/unit/modal.js | 7 | ||||
-rw-r--r-- | js/tests/unit/tab.js | 9 | ||||
-rw-r--r-- | js/tests/unit/tooltip.js | 3 | ||||
-rw-r--r-- | js/tests/unit/transition.js | 13 |
4 files changed, 11 insertions, 21 deletions
diff --git a/js/tests/unit/modal.js b/js/tests/unit/modal.js index 6b20743273..281978142c 100644 --- a/js/tests/unit/modal.js +++ b/js/tests/unit/modal.js @@ -157,16 +157,15 @@ $(function () { 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 + var div = $('<div id="modal-test"><div class="contents"></div></div>') + 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') diff --git a/js/tests/unit/tab.js b/js/tests/unit/tab.js index 59bedf391f..b8dbf2c18e 100644 --- a/js/tests/unit/tab.js +++ b/js/tests/unit/tab.js @@ -73,11 +73,14 @@ $(function () { '</ul>' $(dropHTML).find('ul>li:first a').tab('show').end() - .find('ul>li:last a').on('show', function (event) { + .find('ul>li:last a') + .on('show.bs.tab', function (event) { equal(event.relatedTarget.hash, '#1-1') - }).on('shown', function (event) { + }) + .on('show.bs.tab', function (event) { equal(event.relatedTarget.hash, '#1-1') - }).tab('show') + }) + .tab('show') }) }) diff --git a/js/tests/unit/tooltip.js b/js/tests/unit/tooltip.js index d921bee7fd..2a74b2a55c 100644 --- a/js/tests/unit/tooltip.js +++ b/js/tests/unit/tooltip.js @@ -387,6 +387,8 @@ $(function () { }) test('tooltips should be placed dynamically, with the dynamic placement option', function () { + $(document.body).scrollTop(0) // force to top of page + $.support.transition = false var ttContainer = $('<div id="dynamic-tt-test"/>').css({ 'height' : 400, @@ -402,7 +404,6 @@ $(function () { .tooltip({placement: 'auto'}) .tooltip('show') - ok($('.tooltip').is('.bottom'), 'top positioned tooltip is dynamically positioned bottom') topTooltip.tooltip('hide') diff --git a/js/tests/unit/transition.js b/js/tests/unit/transition.js deleted file mode 100644 index 79722f8082..0000000000 --- a/js/tests/unit/transition.js +++ /dev/null @@ -1,13 +0,0 @@ -$(function () { - - module('transition') - - test('should be defined on jquery support object', function () { - ok($.support.transition !== undefined, 'transition object is defined') - }) - - test('should provide an end object', function () { - ok($.support.transition ? $.support.transition.end : true, 'end string is defined') - }) - -}) |