aboutsummaryrefslogtreecommitdiff
path: root/js/tests/unit
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2012-09-25 22:00:41 -0700
committerMark Otto <[email protected]>2012-09-25 22:00:41 -0700
commitce19e63d5b068ba0698dee4e2d99c725f6799b0d (patch)
treebda8377cdc83204780bdf624833725a127ded586 /js/tests/unit
parent527d01ce99a0cae8eae7868c0649dca60cda338c (diff)
parentf4d3d7da2e3ddbd751e053729935df1f3dd4c051 (diff)
downloadbootstrap-ce19e63d5b068ba0698dee4e2d99c725f6799b0d.tar.xz
bootstrap-ce19e63d5b068ba0698dee4e2d99c725f6799b0d.zip
Merge branch '2.1.2-wip' into box-sizing-exercise
Conflicts: docs/assets/css/bootstrap-responsive.css docs/assets/css/bootstrap.css docs/base-css.html docs/templates/pages/base-css.mustache less/forms.less less/mixins.less
Diffstat (limited to 'js/tests/unit')
-rw-r--r--js/tests/unit/bootstrap-carousel.js2
-rw-r--r--js/tests/unit/bootstrap-popover.js8
-rw-r--r--js/tests/unit/bootstrap-tooltip.js14
-rw-r--r--js/tests/unit/bootstrap-typeahead.js17
4 files changed, 18 insertions, 23 deletions
diff --git a/js/tests/unit/bootstrap-carousel.js b/js/tests/unit/bootstrap-carousel.js
index 4c93c7b18..5ac9fb2d8 100644
--- a/js/tests/unit/bootstrap-carousel.js
+++ b/js/tests/unit/bootstrap-carousel.js
@@ -26,7 +26,7 @@ $(function () {
})
test("should fire slide event with relatedTarget", function () {
- var template = '<div id="myCarousel" class="carousel slide"><div class="carousel-inner"><div class="item active"><img src="assets/img/bootstrap-mdo-sfmoma-01.jpg" alt=""><div class="carousel-caption"><h4>{{_i}}First Thumbnail label{{/i}}</h4><p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p></div></div><div class="item"><img src="assets/img/bootstrap-mdo-sfmoma-02.jpg" alt=""><div class="carousel-caption"><h4>{{_i}}Second Thumbnail label{{/i}}</h4><p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p></div></div><div class="item"><img src="assets/img/bootstrap-mdo-sfmoma-03.jpg" alt=""><div class="carousel-caption"><h4>{{_i}}Third Thumbnail label{{/i}}</h4><p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p></div></div></div><a class="left carousel-control" href="#myCarousel" data-slide="prev">&lsaquo;</a><a class="right carousel-control" href="#myCarousel" data-slide="next">&rsaquo;</a></div>'
+ var template = '<div id="myCarousel" class="carousel slide"><div class="carousel-inner"><div class="item active"><img alt=""><div class="carousel-caption"><h4>{{_i}}First Thumbnail label{{/i}}</h4><p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p></div></div><div class="item"><img alt=""><div class="carousel-caption"><h4>{{_i}}Second Thumbnail label{{/i}}</h4><p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p></div></div><div class="item"><img alt=""><div class="carousel-caption"><h4>{{_i}}Third Thumbnail label{{/i}}</h4><p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p></div></div></div><a class="left carousel-control" href="#myCarousel" data-slide="prev">&lsaquo;</a><a class="right carousel-control" href="#myCarousel" data-slide="next">&rsaquo;</a></div>'
$.support.transition = false
stop()
$(template)
diff --git a/js/tests/unit/bootstrap-popover.js b/js/tests/unit/bootstrap-popover.js
index 04d5279d2..6a5f0bdcf 100644
--- a/js/tests/unit/bootstrap-popover.js
+++ b/js/tests/unit/bootstrap-popover.js
@@ -94,14 +94,14 @@ $(function () {
test("should destroy popover", function () {
var popover = $('<div/>').popover({trigger: 'hover'}).on('click.foo', function(){})
ok(popover.data('popover'), 'popover has data')
- ok(popover.data('events').mouseover && popover.data('events').mouseout, 'popover has hover event')
- ok(popover.data('events').click[0].namespace == 'foo', 'popover has extra click.foo event')
+ ok($._data(popover[0], 'events').mouseover && $._data(popover[0], 'events').mouseout, 'popover has hover event')
+ ok($._data(popover[0], 'events').click[0].namespace == 'foo', 'popover has extra click.foo event')
popover.popover('show')
popover.popover('destroy')
ok(!popover.hasClass('in'), 'popover is hidden')
ok(!popover.data('popover'), 'popover does not have data')
- ok(popover.data('events').click[0].namespace == 'foo', 'popover still has click.foo')
- ok(!popover.data('events').mouseover && !popover.data('events').mouseout, 'popover does not have any events')
+ ok($._data(popover[0],'events').click[0].namespace == 'foo', 'popover still has click.foo')
+ ok(!$._data(popover[0], 'events').mouseover && !$._data(popover[0], 'events').mouseout, 'popover does not have any events')
})
}) \ No newline at end of file
diff --git a/js/tests/unit/bootstrap-tooltip.js b/js/tests/unit/bootstrap-tooltip.js
index 9844d6460..14d6b2274 100644
--- a/js/tests/unit/bootstrap-tooltip.js
+++ b/js/tests/unit/bootstrap-tooltip.js
@@ -113,7 +113,7 @@ $(function () {
}, 50)
})
- test("should show tooltip if leave event hasn't occurred before delay expires", function () {
+ test("should show tooltip if leave event hasn't occured before delay expires", function () {
var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>')
.appendTo('#qunit-fixture')
.tooltip({ delay: 150 })
@@ -131,14 +131,14 @@ $(function () {
test("should destroy tooltip", function () {
var tooltip = $('<div/>').tooltip().on('click.foo', function(){})
ok(tooltip.data('tooltip'), 'tooltip has data')
- ok(tooltip.data('events').mouseover && tooltip.data('events').mouseout, 'tooltip has hover event')
- ok(tooltip.data('events').click[0].namespace == 'foo', 'tooltip has extra click.foo event')
+ ok($._data(tooltip[0], 'events').mouseover && $._data(tooltip[0], 'events').mouseout, 'tooltip has hover event')
+ ok($._data(tooltip[0], 'events').click[0].namespace == 'foo', 'tooltip has extra click.foo event')
tooltip.tooltip('show')
tooltip.tooltip('destroy')
ok(!tooltip.hasClass('in'), 'tooltip is hidden')
- ok(!tooltip.data('tooltip'), 'tooltip does not have data')
- ok(tooltip.data('events').click[0].namespace == 'foo', 'tooltip still has click.foo')
- ok(!tooltip.data('events').mouseover && !tooltip.data('events').mouseout, 'tooltip does not have any events')
+ ok(!$._data(tooltip[0], 'tooltip'), 'tooltip does not have data')
+ ok($._data(tooltip[0], 'events').click[0].namespace == 'foo', 'tooltip still has click.foo')
+ ok(!$._data(tooltip[0], 'events').mouseover && !$._data(tooltip[0], 'events').mouseout, 'tooltip does not have any events')
})
-})
+}) \ No newline at end of file
diff --git a/js/tests/unit/bootstrap-typeahead.js b/js/tests/unit/bootstrap-typeahead.js
index eb447aaa6..16bdb9194 100644
--- a/js/tests/unit/bootstrap-typeahead.js
+++ b/js/tests/unit/bootstrap-typeahead.js
@@ -13,14 +13,9 @@ $(function () {
test("should listen to an input", function () {
var $input = $('<input />')
$input.typeahead()
- ok($input.data('events').blur, 'has a blur event')
- ok($input.data('events').keypress, 'has a keypress event')
- ok($input.data('events').keyup, 'has a keyup event')
- if ($.browser.webkit || $.browser.msie) {
- ok($input.data('events').keydown, 'has a keydown event')
- } else {
- ok($input.data('events').keydown, 'does not have a keydown event')
- }
+ ok($._data($input[0], 'events').blur, 'has a blur event')
+ ok($._data($input[0], 'events').keypress, 'has a keypress event')
+ ok($._data($input[0], 'events').keyup, 'has a keyup event')
})
test("should create a menu", function () {
@@ -32,8 +27,8 @@ $(function () {
var $input = $('<input />')
, $menu = $input.typeahead().data('typeahead').$menu
- ok($menu.data('events').mouseover, 'has a mouseover(pseudo: mouseenter)')
- ok($menu.data('events').click, 'has a click')
+ ok($._data($menu[0], 'events').mouseover, 'has a mouseover(pseudo: mouseenter)')
+ ok($._data($menu[0], 'events').click, 'has a click')
})
test("should show menu when query entered", function () {
@@ -201,4 +196,4 @@ $(function () {
typeahead.$menu.remove()
})
-})
+}) \ No newline at end of file