$(function () {
module("bootstrap-dropdowns")
test("should be defined on jquery object", function () {
ok($(document.body).dropdown, 'dropdown method is defined')
})
test("should return element", function () {
ok($(document.body).dropdown()[0] == document.body, 'document.body returned')
})
test("should not open dropdown if target is disabled", function () {
var dropdownHTML = '
'
, dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').dropdown().click()
ok(!dropdown.parent('.dropdown').hasClass('open'), 'open class added on click')
})
test("should not open dropdown if target is disabled", function () {
var dropdownHTML = '
'
, dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').dropdown().click()
ok(!dropdown.parent('.dropdown').hasClass('open'), 'open class added on click')
})
test("should add class open to menu if clicked", function () {
var dropdownHTML = '
'
, dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').dropdown().click()
ok(dropdown.parent('.dropdown').hasClass('open'), 'open class added on click')
})
test("should test if element has a # before assuming it's a selector", function () {
var dropdownHTML = '
'
, dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').dropdown().click()
ok(dropdown.parent('.dropdown').hasClass('open'), 'open class added on click')
})
test("should remove open class if body clicked", function () {
var dropdownHTML = '