Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'js/tests/unit/dropdown.js')
-rw-r--r--js/tests/unit/dropdown.js34
1 files changed, 17 insertions, 17 deletions
diff --git a/js/tests/unit/dropdown.js b/js/tests/unit/dropdown.js
index 02256965d5..c94cf4fca4 100644
--- a/js/tests/unit/dropdown.js
+++ b/js/tests/unit/dropdown.js
@@ -1,23 +1,23 @@
$(function () {
- module("dropdowns")
+ module('dropdowns')
- test("should provide no conflict", function () {
+ 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 () {
+ test('should be defined on jquery object', function () {
ok($(document.body).dropdown, 'dropdown method is defined')
})
- test("should return element", function () {
- var el = $("<div />")
+ test('should return element', function () {
+ var el = $('<div />')
ok(el.dropdown()[0] === el[0], 'same element returned')
})
- test("should not open dropdown if target is disabled", function () {
+ test('should not open dropdown if target is disabled', function () {
var dropdownHTML = '<ul class="tabs">'
+ '<li class="dropdown">'
+ '<button disabled href="#" class="btn dropdown-toggle" data-toggle="dropdown">Dropdown</button>'
@@ -34,7 +34,7 @@ $(function () {
ok(!dropdown.parent('.dropdown').hasClass('open'), 'open class added on click')
})
- test("should not open dropdown if target is disabled", function () {
+ test('should not open dropdown if target is disabled', function () {
var dropdownHTML = '<ul class="tabs">'
+ '<li class="dropdown">'
+ '<button href="#" class="btn dropdown-toggle disabled" data-toggle="dropdown">Dropdown</button>'
@@ -51,7 +51,7 @@ $(function () {
ok(!dropdown.parent('.dropdown').hasClass('open'), 'open class added on click')
})
- test("should add class open to menu if clicked", function () {
+ test('should add class open to menu if clicked', function () {
var dropdownHTML = '<ul class="tabs">'
+ '<li class="dropdown">'
+ '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>'
@@ -68,7 +68,7 @@ $(function () {
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 () {
+ test('should test if element has a # before assuming it\'s a selector', function () {
var dropdownHTML = '<ul class="tabs">'
+ '<li class="dropdown">'
+ '<a href="/foo/" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>'
@@ -86,7 +86,7 @@ $(function () {
})
- test("should remove open class if body clicked", function () {
+ test('should remove open class if body clicked', function () {
var dropdownHTML = '<ul class="tabs">'
+ '<li class="dropdown">'
+ '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>'
@@ -110,7 +110,7 @@ $(function () {
dropdown.remove()
})
- test("should remove open class if body clicked, with multiple drop downs", function () {
+ test('should remove open class if body clicked, with multiple drop downs', function () {
var dropdownHTML =
'<ul class="nav">'
+ ' <li><a href="#menu1">Menu 1</a></li>'
@@ -132,24 +132,24 @@ $(function () {
, first = dropdowns.first()
, last = dropdowns.last()
- ok(dropdowns.length == 2, "Should be two dropdowns")
+ 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')
$('body').click()
- ok($("#qunit-fixture .open").length === 0, 'open class removed')
+ ok($('#qunit-fixture .open').length === 0, 'open class removed')
last.click()
ok(last.parent('.open').length == 1, 'open class added on click')
ok($('#qunit-fixture .open').length == 1, 'only one object is open')
$('body').click()
- ok($("#qunit-fixture .open").length === 0, 'open class removed')
+ ok($('#qunit-fixture .open').length === 0, 'open class removed')
- $("#qunit-fixture").html("")
+ $('#qunit-fixture').html('')
})
- test("should fire show and hide event", function () {
+ test('should fire show and hide event', function () {
var dropdownHTML = '<ul class="tabs">'
+ '<li class="dropdown">'
+ '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>'
@@ -183,7 +183,7 @@ $(function () {
})
- test("should fire shown and hiden event", function () {
+ test('should fire shown and hiden event', function () {
var dropdownHTML = '<ul class="tabs">'
+ '<li class="dropdown">'
+ '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>'