From bf39bb3ac3d2aef4687b3cd4762015d5f218e2bc Mon Sep 17 00:00:00 2001 From: Starsam80 Date: Thu, 27 Oct 2016 16:13:17 -0600 Subject: Rename `.active` to `.show` --- js/tests/unit/alert.js | 6 +++--- js/tests/unit/collapse.js | 32 ++++++++++++++++---------------- js/tests/unit/dropdown.js | 34 +++++++++++++++++----------------- js/tests/unit/popover.js | 2 +- js/tests/unit/tooltip.js | 40 ++++++++++++++++++++-------------------- 5 files changed, 57 insertions(+), 57 deletions(-) (limited to 'js/tests/unit') diff --git a/js/tests/unit/alert.js b/js/tests/unit/alert.js index 9548c3318..e078082c3 100644 --- a/js/tests/unit/alert.js +++ b/js/tests/unit/alert.js @@ -34,7 +34,7 @@ $(function () { QUnit.test('should fade element out on clicking .close', function (assert) { assert.expect(1) - var alertHTML = '
' + var alertHTML = '
' + '×' + '

Holy guacamole! Best check yo self, you\'re not looking too good.

' + '
' @@ -43,12 +43,12 @@ $(function () { $alert.find('.close').trigger('click') - assert.strictEqual($alert.hasClass('active'), false, 'remove .active class on .close click') + assert.strictEqual($alert.hasClass('show'), false, 'remove .show class on .close click') }) QUnit.test('should remove element when clicking .close', function (assert) { assert.expect(2) - var alertHTML = '
' + var alertHTML = '
' + '×' + '

Holy guacamole! Best check yo self, you\'re not looking too good.

' + '
' diff --git a/js/tests/unit/collapse.js b/js/tests/unit/collapse.js index 7db69e2cf..713930433 100644 --- a/js/tests/unit/collapse.js +++ b/js/tests/unit/collapse.js @@ -48,7 +48,7 @@ $(function () { assert.expect(2) var $el = $('
').bootstrapCollapse('show') - assert.ok($el.hasClass('active'), 'has class "active"') + assert.ok($el.hasClass('show'), 'has class "show"') assert.ok(!/height/i.test($el.attr('style')), 'has height reset') }) @@ -62,7 +62,7 @@ $(function () { '
', '
', '
', - '
', + '
', '
', '
' ].join('') @@ -71,15 +71,15 @@ $(function () { var $el2 = $('#collapse2') $el1.bootstrapCollapse('show') - assert.ok($el1.hasClass('active')) - assert.ok($el2.hasClass('active')) + assert.ok($el1.hasClass('show')) + assert.ok($el2.hasClass('show')) }) QUnit.test('should hide a collapsed element', function (assert) { assert.expect(1) var $el = $('
').bootstrapCollapse('hide') - assert.ok(!$el.hasClass('active'), 'does not have class "active"') + assert.ok(!$el.hasClass('show'), 'does not have class "show"') }) QUnit.test('should not fire shown when show is prevented', function (assert) { @@ -150,7 +150,7 @@ $(function () { var $target = $('').appendTo('#qunit-fixture') - $('
') + $('
') .appendTo('#qunit-fixture') .on('hidden.bs.collapse', function () { assert.ok($target.hasClass('collapsed'), 'target has collapsed class') @@ -185,7 +185,7 @@ $(function () { var $target = $('').appendTo('#qunit-fixture') var $alt = $('').appendTo('#qunit-fixture') - $('
') + $('
') .appendTo('#qunit-fixture') .on('hidden.bs.collapse', function () { assert.ok($target.hasClass('collapsed'), 'target has collapsed class') @@ -200,7 +200,7 @@ $(function () { assert.expect(0) var done = assert.async() - var $test = $('
') + var $test = $('
') .appendTo('#qunit-fixture') .on('hide.bs.collapse', function () { assert.ok(false) @@ -244,7 +244,7 @@ $(function () { assert.expect(1) var done = assert.async() - $('
') + $('
') .appendTo('#qunit-fixture') .on('hide.bs.collapse', function () { assert.ok(true, 'hiding a previously-uninitialized shown collapse when the "hide" method is called') @@ -267,7 +267,7 @@ $(function () { var $target1 = $('
').appendTo($groups.eq(0)) - $('
').appendTo($groups.eq(0)) + $('
').appendTo($groups.eq(0)) var $target2 = $('').appendTo($groups.eq(0)) - $('
').appendTo($groups.eq(0)) + $('
').appendTo($groups.eq(0)) var $target2 = $('').appendTo('#qunit-fixture') - $('
') + $('
') .appendTo('#qunit-fixture') .on('hidden.bs.collapse', function () { assert.strictEqual($target.attr('aria-expanded'), 'false', 'aria-expanded on target is "false"') @@ -379,7 +379,7 @@ $(function () { var $target = $('').appendTo('#qunit-fixture') var $alt = $('').appendTo('#qunit-fixture') - $('
') + $('
') .appendTo('#qunit-fixture') .on('hidden.bs.collapse', function () { assert.strictEqual($target.attr('aria-expanded'), 'false', 'aria-expanded on target is "false"') @@ -403,7 +403,7 @@ $(function () { var $target1 = $('').appendTo($groups.eq(0)) - $('
').appendTo($groups.eq(0)) + $('
').appendTo($groups.eq(0)) var $target2 = $('').appendTo('#qunit-fixture') - $('
') + $('
') .appendTo('#qunit-fixture') .on('hidden.bs.collapse', function () { assert.ok($target.hasClass('collapsed')) 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 () { + '' 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 () { + '' 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 = '
    ' + '
' 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 () { + '' 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 = '
    ' + '