aboutsummaryrefslogtreecommitdiff
path: root/js/tests
diff options
context:
space:
mode:
authorfat <[email protected]>2012-12-07 17:06:01 -0500
committerfat <[email protected]>2012-12-07 17:06:01 -0500
commita7eb9c294a575b5471ddec45ae75e1d09f7ace4c (patch)
treee55d0f54282e2f9f41c7ba87254e2ab9928f10ee /js/tests
parent1c5b8e967e2b421503bc010d4ed3b79406ea5b7b (diff)
downloadbootstrap-a7eb9c294a575b5471ddec45ae75e1d09f7ace4c.tar.xz
bootstrap-a7eb9c294a575b5471ddec45ae75e1d09f7ace4c.zip
add noConflict functionality to all bootstrap plugins
Diffstat (limited to 'js/tests')
-rw-r--r--js/tests/unit/bootstrap-affix.js6
-rw-r--r--js/tests/unit/bootstrap-alert.js6
-rw-r--r--js/tests/unit/bootstrap-button.js6
-rw-r--r--js/tests/unit/bootstrap-carousel.js6
-rw-r--r--js/tests/unit/bootstrap-collapse.js6
-rw-r--r--js/tests/unit/bootstrap-dropdown.js10
-rw-r--r--js/tests/unit/bootstrap-modal.js6
-rw-r--r--js/tests/unit/bootstrap-popover.js12
-rw-r--r--js/tests/unit/bootstrap-scrollspy.js6
-rw-r--r--js/tests/unit/bootstrap-tab.js6
-rw-r--r--js/tests/unit/bootstrap-tooltip.js6
-rw-r--r--js/tests/unit/bootstrap-typeahead.js6
12 files changed, 77 insertions, 5 deletions
diff --git a/js/tests/unit/bootstrap-affix.js b/js/tests/unit/bootstrap-affix.js
index bc25df991..c97887890 100644
--- a/js/tests/unit/bootstrap-affix.js
+++ b/js/tests/unit/bootstrap-affix.js
@@ -2,6 +2,12 @@ $(function () {
module("bootstrap-affix")
+ test("should provide no conflict", function () {
+ var affix = $.fn.affix.noConflict()
+ ok(!$.fn.affix, 'affix was set back to undefined (org value)')
+ $.fn.affix = affix
+ })
+
test("should be defined on jquery object", function () {
ok($(document.body).affix, 'affix method is defined')
})
diff --git a/js/tests/unit/bootstrap-alert.js b/js/tests/unit/bootstrap-alert.js
index 7f24e0e6b..9a6b514c4 100644
--- a/js/tests/unit/bootstrap-alert.js
+++ b/js/tests/unit/bootstrap-alert.js
@@ -2,6 +2,12 @@ $(function () {
module("bootstrap-alerts")
+ test("should provide no conflict", function () {
+ var alert = $.fn.alert.noConflict()
+ ok(!$.fn.alert, 'alert was set back to undefined (org value)')
+ $.fn.alert = alert
+ })
+
test("should be defined on jquery object", function () {
ok($(document.body).alert, 'alert method is defined')
})
diff --git a/js/tests/unit/bootstrap-button.js b/js/tests/unit/bootstrap-button.js
index b5d083499..e23ff9e30 100644
--- a/js/tests/unit/bootstrap-button.js
+++ b/js/tests/unit/bootstrap-button.js
@@ -2,6 +2,12 @@ $(function () {
module("bootstrap-buttons")
+ test("should provide no conflict", function () {
+ var button = $.fn.button.noConflict()
+ ok(!$.fn.button, 'button was set back to undefined (org value)')
+ $.fn.button = button
+ })
+
test("should be defined on jquery object", function () {
ok($(document.body).button, 'button method is defined')
})
diff --git a/js/tests/unit/bootstrap-carousel.js b/js/tests/unit/bootstrap-carousel.js
index 8bd1b62ba..13b8f721f 100644
--- a/js/tests/unit/bootstrap-carousel.js
+++ b/js/tests/unit/bootstrap-carousel.js
@@ -2,6 +2,12 @@ $(function () {
module("bootstrap-carousel")
+ test("should provide no conflict", function () {
+ var carousel = $.fn.carousel.noConflict()
+ ok(!$.fn.carousel, 'carousel was set back to undefined (org value)')
+ $.fn.carousel = carousel
+ })
+
test("should be defined on jquery object", function () {
ok($(document.body).carousel, 'carousel method is defined')
})
diff --git a/js/tests/unit/bootstrap-collapse.js b/js/tests/unit/bootstrap-collapse.js
index 6cc7ac7a4..4c5916ecd 100644
--- a/js/tests/unit/bootstrap-collapse.js
+++ b/js/tests/unit/bootstrap-collapse.js
@@ -2,6 +2,12 @@ $(function () {
module("bootstrap-collapse")
+ test("should provide no conflict", function () {
+ var collapse = $.fn.collapse.noConflict()
+ ok(!$.fn.collapse, 'collapse was set back to undefined (org value)')
+ $.fn.collapse = collapse
+ })
+
test("should be defined on jquery object", function () {
ok($(document.body).collapse, 'collapse method is defined')
})
diff --git a/js/tests/unit/bootstrap-dropdown.js b/js/tests/unit/bootstrap-dropdown.js
index 3788209ec..2f0d2d29e 100644
--- a/js/tests/unit/bootstrap-dropdown.js
+++ b/js/tests/unit/bootstrap-dropdown.js
@@ -2,6 +2,12 @@ $(function () {
module("bootstrap-dropdowns")
+ test("should provide no conflict", function () {
+ var dropdown = $.fn.dropdown.noConflict()
+ ok(!$.fn.dropdown, 'dropdown was set back to undefined (org value)')
+ $.fn.dropdown = dropdown
+ })
+
test("should be defined on jquery object", function () {
ok($(document.body).dropdown, 'dropdown method is defined')
})
@@ -104,7 +110,7 @@ $(function () {
})
test("should remove open class if body clicked, with multiple drop downs", function () {
- var dropdownHTML =
+ var dropdownHTML =
'<ul class="nav">'
+ ' <li><a href="#menu1">Menu 1</a></li>'
+ ' <li class="dropdown" id="testmenu">'
@@ -126,7 +132,7 @@ $(function () {
, last = dropdowns.last()
ok(dropdowns.length == 2, "Should be two dropdowns")
-
+
first.click()
ok(first.parents('.open').length == 1, 'open class added on click')
ok($('#qunit-fixture .open').length == 1, 'only one object is open')
diff --git a/js/tests/unit/bootstrap-modal.js b/js/tests/unit/bootstrap-modal.js
index 0851f64a7..98aa990a6 100644
--- a/js/tests/unit/bootstrap-modal.js
+++ b/js/tests/unit/bootstrap-modal.js
@@ -2,6 +2,12 @@ $(function () {
module("bootstrap-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')
diff --git a/js/tests/unit/bootstrap-popover.js b/js/tests/unit/bootstrap-popover.js
index 6a5f0bdcf..20234e147 100644
--- a/js/tests/unit/bootstrap-popover.js
+++ b/js/tests/unit/bootstrap-popover.js
@@ -2,6 +2,12 @@ $(function () {
module("bootstrap-popover")
+ test("should provide no conflict", function () {
+ var popover = $.fn.popover.noConflict()
+ ok(!$.fn.popover, 'popover was set back to undefined (org value)')
+ $.fn.popover = popover
+ })
+
test("should be defined on jquery object", function () {
var div = $('<div></div>')
ok(div.popover, 'popover method is defined')
@@ -70,7 +76,7 @@ $(function () {
ok(!$('.popover').length, 'popover was removed')
$('#qunit-fixture').empty()
})
-
+
test("should respect custom classes", function() {
$.support.transition = false
var popover = $('<a href="#">@fat</a>')
@@ -80,7 +86,7 @@ $(function () {
, content: 'Test'
, template: '<div class="popover foobar"><div class="arrow"></div><div class="inner"><h3 class="title"></h3><div class="content"><p></p></div></div></div>'
})
-
+
popover.popover('show')
ok($('.popover').length, 'popover was inserted')
@@ -103,5 +109,5 @@ $(function () {
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-scrollspy.js b/js/tests/unit/bootstrap-scrollspy.js
index bee46a925..32bfa7134 100644
--- a/js/tests/unit/bootstrap-scrollspy.js
+++ b/js/tests/unit/bootstrap-scrollspy.js
@@ -2,6 +2,12 @@ $(function () {
module("bootstrap-scrollspy")
+ test("should provide no conflict", function () {
+ var scrollspy = $.fn.scrollspy.noConflict()
+ ok(!$.fn.scrollspy, 'scrollspy was set back to undefined (org value)')
+ $.fn.scrollspy = scrollspy
+ })
+
test("should be defined on jquery object", function () {
ok($(document.body).scrollspy, 'scrollspy method is defined')
})
diff --git a/js/tests/unit/bootstrap-tab.js b/js/tests/unit/bootstrap-tab.js
index 40f9a7406..ba5910d5e 100644
--- a/js/tests/unit/bootstrap-tab.js
+++ b/js/tests/unit/bootstrap-tab.js
@@ -2,6 +2,12 @@ $(function () {
module("bootstrap-tabs")
+ test("should provide no conflict", function () {
+ var tab = $.fn.tab.noConflict()
+ ok(!$.fn.tab, 'tab was set back to undefined (org value)')
+ $.fn.tab = tab
+ })
+
test("should be defined on jquery object", function () {
ok($(document.body).tab, 'tabs method is defined')
})
diff --git a/js/tests/unit/bootstrap-tooltip.js b/js/tests/unit/bootstrap-tooltip.js
index bbdf3ce80..ba5134743 100644
--- a/js/tests/unit/bootstrap-tooltip.js
+++ b/js/tests/unit/bootstrap-tooltip.js
@@ -2,6 +2,12 @@ $(function () {
module("bootstrap-tooltip")
+ test("should provide no conflict", function () {
+ var tooltip = $.fn.tooltip.noConflict()
+ ok(!$.fn.tooltip, 'tooltip was set back to undefined (org value)')
+ $.fn.tooltip = tooltip
+ })
+
test("should be defined on jquery object", function () {
var div = $("<div></div>")
ok(div.tooltip, 'popover method is defined')
diff --git a/js/tests/unit/bootstrap-typeahead.js b/js/tests/unit/bootstrap-typeahead.js
index 16bdb9194..0f7aed27d 100644
--- a/js/tests/unit/bootstrap-typeahead.js
+++ b/js/tests/unit/bootstrap-typeahead.js
@@ -2,6 +2,12 @@ $(function () {
module("bootstrap-typeahead")
+ test("should provide no conflict", function () {
+ var typeahead = $.fn.typeahead.noConflict()
+ ok(!$.fn.typeahead, 'typeahead was set back to undefined (org value)')
+ $.fn.typeahead = typeahead
+ })
+
test("should be defined on jquery object", function () {
ok($(document.body).typeahead, 'alert method is defined')
})