aboutsummaryrefslogtreecommitdiff
path: root/js/tests/unit/dropdown.js
diff options
context:
space:
mode:
authorStarsam80 <[email protected]>2016-10-27 16:13:17 -0600
committerStarsam80 <[email protected]>2016-12-07 21:20:15 -0700
commitbf39bb3ac3d2aef4687b3cd4762015d5f218e2bc (patch)
tree968d25a858633f88255e3cc6c923f07a7c44d36c /js/tests/unit/dropdown.js
parentede925d79bf92d5983a4508c6ed6fda9310e1e8b (diff)
downloadbootstrap-bf39bb3ac3d2aef4687b3cd4762015d5f218e2bc.tar.xz
bootstrap-bf39bb3ac3d2aef4687b3cd4762015d5f218e2bc.zip
Rename `.active` to `.show`
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 7e8ecae4e..53455c2a6 100644
--- a/js/tests/unit/dropdown.js
+++ b/js/tests/unit/dropdown.js
@@ -59,7 +59,7 @@ $(function () {
+ '</ul>'
var $dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').bootstrapDropdown().trigger('click')
- assert.ok(!$dropdown.parent('.dropdown').hasClass('active'), '"active" class added on click')
+ assert.ok(!$dropdown.parent('.dropdown').hasClass('show'), '"show" class added on click')
})
QUnit.test('should set aria-expanded="true" on target when dropdown menu is shown', function (assert) {
@@ -128,10 +128,10 @@ $(function () {
+ '</ul>'
var $dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').bootstrapDropdown().trigger('click')
- assert.ok(!$dropdown.parent('.dropdown').hasClass('active'), '"active" class added on click')
+ assert.ok(!$dropdown.parent('.dropdown').hasClass('show'), '"show" class added on click')
})
- QUnit.test('should add class active to menu if clicked', function (assert) {
+ QUnit.test('should add class show to menu if clicked', function (assert) {
assert.expect(1)
var dropdownHTML = '<ul class="tabs">'
+ '<li class="dropdown">'
@@ -146,7 +146,7 @@ $(function () {
+ '</ul>'
var $dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').bootstrapDropdown().trigger('click')
- assert.ok($dropdown.parent('.dropdown').hasClass('active'), '"active" class added on click')
+ assert.ok($dropdown.parent('.dropdown').hasClass('show'), '"show" class added on click')
})
QUnit.test('should test if element has a # before assuming it\'s a selector', function (assert) {
@@ -164,11 +164,11 @@ $(function () {
+ '</ul>'
var $dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').bootstrapDropdown().trigger('click')
- assert.ok($dropdown.parent('.dropdown').hasClass('active'), '"active" class added on click')
+ assert.ok($dropdown.parent('.dropdown').hasClass('show'), '"show" class added on click')
})
- QUnit.test('should remove "active" class if body is clicked', function (assert) {
+ QUnit.test('should remove "show" class if body is clicked', function (assert) {
assert.expect(2)
var dropdownHTML = '<ul class="tabs">'
+ '<li class="dropdown">'
@@ -187,12 +187,12 @@ $(function () {
.bootstrapDropdown()
.trigger('click')
- assert.ok($dropdown.parent('.dropdown').hasClass('active'), '"active" class added on click')
+ assert.ok($dropdown.parent('.dropdown').hasClass('show'), '"show" class added on click')
$(document.body).trigger('click')
- assert.ok(!$dropdown.parent('.dropdown').hasClass('active'), '"active" class removed')
+ assert.ok(!$dropdown.parent('.dropdown').hasClass('show'), '"show" class removed')
})
- QUnit.test('should remove "active" class if body is clicked, with multiple dropdowns', function (assert) {
+ QUnit.test('should remove "show" class if body is clicked, with multiple dropdowns', function (assert) {
assert.expect(7)
var dropdownHTML = '<ul class="nav">'
+ '<li><a href="#menu1">Menu 1</a></li>'
@@ -217,16 +217,16 @@ $(function () {
assert.strictEqual($dropdowns.length, 2, 'two dropdowns')
$first.trigger('click')
- assert.strictEqual($first.parents('.active').length, 1, '"active" class added on click')
- assert.strictEqual($('#qunit-fixture .active').length, 1, 'only one dropdown is active')
+ assert.strictEqual($first.parents('.show').length, 1, '"show" class added on click')
+ assert.strictEqual($('#qunit-fixture .show').length, 1, 'only one dropdown is shown')
$(document.body).trigger('click')
- assert.strictEqual($('#qunit-fixture .active').length, 0, '"active" class removed')
+ assert.strictEqual($('#qunit-fixture .show').length, 0, '"show" class removed')
$last.trigger('click')
- assert.strictEqual($last.parent('.active').length, 1, '"active" class added on click')
- assert.strictEqual($('#qunit-fixture .active').length, 1, 'only one dropdown is active')
+ assert.strictEqual($last.parent('.show').length, 1, '"show" class added on click')
+ assert.strictEqual($('#qunit-fixture .show').length, 1, 'only one dropdown is shown')
$(document.body).trigger('click')
- assert.strictEqual($('#qunit-fixture .active').length, 0, '"active" class removed')
+ assert.strictEqual($('#qunit-fixture .show').length, 0, '"show" class removed')
})
QUnit.test('should fire show and hide event', function (assert) {
@@ -411,7 +411,7 @@ $(function () {
$('#textField').trigger('click')
- assert.ok($dropdown.parent('.btn-group').hasClass('active'), 'dropdown menu is active')
+ assert.ok($dropdown.parent('.btn-group').hasClass('show'), 'dropdown menu is shown')
})
QUnit.test('should not close the dropdown if the user clicks on a textarea', function (assert) {
@@ -430,6 +430,6 @@ $(function () {
$('#textArea').trigger('click')
- assert.ok($dropdown.parent('.btn-group').hasClass('active'), 'dropdown menu is active')
+ assert.ok($dropdown.parent('.btn-group').hasClass('show'), 'dropdown menu is shown')
})
})