From 7b24f3c47c195b5519ddc2904840db98858ec015 Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Fri, 25 Oct 2013 14:14:30 -0700 Subject: QUnit.equals() is deprecated; use QUnit.equal() instead --- js/tests/unit/button.js | 10 +++++----- js/tests/unit/popover.js | 12 ++++++------ js/tests/unit/tab.js | 12 ++++++------ js/tests/unit/tooltip.js | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) (limited to 'js/tests/unit') diff --git a/js/tests/unit/button.js b/js/tests/unit/button.js index 41ddb5c2f..16284e0ce 100644 --- a/js/tests/unit/button.js +++ b/js/tests/unit/button.js @@ -18,9 +18,9 @@ $(function () { test("should return set state to loading", function () { var btn = $('') - equals(btn.html(), 'mdo', 'btn text equals mdo') + equal(btn.html(), 'mdo', 'btn text equals mdo') btn.button('loading') - equals(btn.html(), 'fat', 'btn text equals fat') + equal(btn.html(), 'fat', 'btn text equals fat') stop() setTimeout(function () { ok(btn.attr('disabled'), 'btn is disabled') @@ -31,9 +31,9 @@ $(function () { test("should return reset state", function () { var btn = $('') - equals(btn.html(), 'mdo', 'btn text equals mdo') + equal(btn.html(), 'mdo', 'btn text equals mdo') btn.button('loading') - equals(btn.html(), 'fat', 'btn text equals fat') + equal(btn.html(), 'fat', 'btn text equals fat') stop() setTimeout(function () { ok(btn.attr('disabled'), 'btn is disabled') @@ -41,7 +41,7 @@ $(function () { start() stop() btn.button('reset') - equals(btn.html(), 'mdo', 'btn text equals mdo') + equal(btn.html(), 'mdo', 'btn text equals mdo') setTimeout(function () { ok(!btn.attr('disabled'), 'btn is not disabled') ok(!btn.hasClass('disabled'), 'btn does not have disabled class') diff --git a/js/tests/unit/popover.js b/js/tests/unit/popover.js index 767d79864..c9f7d63a7 100644 --- a/js/tests/unit/popover.js +++ b/js/tests/unit/popover.js @@ -53,8 +53,8 @@ $(function () { popover.popover('show') ok($('.popover').length, 'popover was inserted') - equals($('.popover .popover-title').text(), '@fat', 'title correctly inserted') - equals($('.popover .popover-content').text(), 'loves writing tests (╯°□°)╯︵ ┻━┻', 'content correctly inserted') + equal($('.popover .popover-title').text(), '@fat', 'title correctly inserted') + equal($('.popover .popover-content').text(), 'loves writing tests (╯°□°)╯︵ ┻━┻', 'content correctly inserted') popover.popover('hide') ok(!$('.popover').length, 'popover was removed') @@ -69,8 +69,8 @@ $(function () { .popover('show') ok($('.popover').length, 'popover was inserted') - equals($('.popover .popover-title').text(), '@mdo', 'title correctly inserted') - equals($('.popover .popover-content').text(), "loves data attributes (づ。◕‿‿◕。)づ ︵ ┻━┻", 'content correctly inserted') + equal($('.popover .popover-title').text(), '@mdo', 'title correctly inserted') + equal($('.popover .popover-content').text(), "loves data attributes (づ。◕‿‿◕。)づ ︵ ┻━┻", 'content correctly inserted') popover.popover('hide') ok(!$('.popover').length, 'popover was removed') @@ -89,8 +89,8 @@ $(function () { .popover('show') ok($('.popover').length, 'popover was inserted') - equals($('.popover .popover-title').text(), '@mdo', 'title correctly inserted') - equals($('.popover .popover-content').text(), "loves data attributes (づ。◕‿‿◕。)づ ︵ ┻━┻", 'content correctly inserted') + equal($('.popover .popover-title').text(), '@mdo', 'title correctly inserted') + equal($('.popover .popover-content').text(), "loves data attributes (づ。◕‿‿◕。)づ ︵ ┻━┻", 'content correctly inserted') popover.popover('hide') ok(!$('.popover').length, 'popover was removed') diff --git a/js/tests/unit/tab.js b/js/tests/unit/tab.js index aede32abb..0db7cdb5b 100644 --- a/js/tests/unit/tab.js +++ b/js/tests/unit/tab.js @@ -26,10 +26,10 @@ $(function () { $('').appendTo("#qunit-fixture") $(tabsHTML).find('li:last a').tab('show') - equals($("#qunit-fixture").find('.active').attr('id'), "profile") + equal($("#qunit-fixture").find('.active').attr('id'), "profile") $(tabsHTML).find('li:first a').tab('show') - equals($("#qunit-fixture").find('.active').attr('id'), "home") + equal($("#qunit-fixture").find('.active').attr('id'), "home") }) test("should activate element by tab id", function () { @@ -42,10 +42,10 @@ $(function () { $('').appendTo("#qunit-fixture") $(pillsHTML).find('li:last a').tab('show') - equals($("#qunit-fixture").find('.active').attr('id'), "profile") + equal($("#qunit-fixture").find('.active').attr('id'), "profile") $(pillsHTML).find('li:first a').tab('show') - equals($("#qunit-fixture").find('.active').attr('id'), "home") + equal($("#qunit-fixture").find('.active').attr('id'), "home") }) @@ -77,9 +77,9 @@ $(function () { $(dropHTML).find('ul>li:first a').tab('show').end() .find('ul>li:last a').on('show', function(event){ - equals(event.relatedTarget.hash, "#1-1") + equal(event.relatedTarget.hash, "#1-1") }).on('shown', function(event){ - equals(event.relatedTarget.hash, "#1-1") + equal(event.relatedTarget.hash, "#1-1") }).tab('show') }) diff --git a/js/tests/unit/tooltip.js b/js/tests/unit/tooltip.js index ed1bf54b3..dc3ddd377 100644 --- a/js/tests/unit/tooltip.js +++ b/js/tests/unit/tooltip.js @@ -29,7 +29,7 @@ $(function () { test("should add data attribute for referencing original title", function () { var tooltip = $('').tooltip() - equals(tooltip.attr('data-original-title'), 'Another tooltip', 'original title preserved in data attribute') + equal(tooltip.attr('data-original-title'), 'Another tooltip', 'original title preserved in data attribute') }) test("should place tooltips relative to placement option", function () { -- cgit v1.2.3 From 934d1bcae588a278900018abb648242eb05328b3 Mon Sep 17 00:00:00 2001 From: Nathan Muir Date: Tue, 3 Sep 2013 12:23:51 +1000 Subject: Add unit test for #9920 Merges #10385 --- js/tests/unit/button.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'js/tests/unit') diff --git a/js/tests/unit/button.js b/js/tests/unit/button.js index 16284e0ce..115edefaf 100644 --- a/js/tests/unit/button.js +++ b/js/tests/unit/button.js @@ -111,6 +111,12 @@ $(function () { ok(!btn1.find('input').prop('checked'), 'btn1 is checked') ok(btn2.hasClass('active'), 'btn2 has active class') ok(btn2.find('input').prop('checked'), 'btn2 is checked') + + btn2.find('input').click() /* clicking an already checked radio should not un-check it */ + ok(!btn1.hasClass('active'), 'btn1 does not have active class') + ok(!btn1.find('input').prop('checked'), 'btn1 is checked') + ok(btn2.hasClass('active'), 'btn2 has active class') + ok(btn2.find('input').prop('checked'), 'btn2 is checked') }) }) -- cgit v1.2.3 From 4aad52797c9ec43c30561f481f595be178f6ab94 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Fri, 6 Dec 2013 12:20:59 +0200 Subject: Use a space after function consistently. --- js/tests/unit/modal.js | 14 +++++++------- js/tests/unit/phantom.js | 8 ++++---- js/tests/unit/popover.js | 4 ++-- js/tests/unit/tab.js | 4 ++-- js/tests/unit/tooltip.js | 34 +++++++++++++++++----------------- 5 files changed, 32 insertions(+), 32 deletions(-) (limited to 'js/tests/unit') diff --git a/js/tests/unit/modal.js b/js/tests/unit/modal.js index 5755d2751..a6dade99b 100644 --- a/js/tests/unit/modal.js +++ b/js/tests/unit/modal.js @@ -74,7 +74,7 @@ $(function () { ok($('#modal-test').length, 'modal inserted into dom') $(this).modal("hide") }) - .on("hidden.bs.modal", function() { + .on("hidden.bs.modal", function () { ok(!$('#modal-test').is(":visible"), 'modal hidden') $('#modal-test').remove() start() @@ -92,7 +92,7 @@ $(function () { ok($('#modal-test').length, 'modal inserted into dom') div.modal("toggle") }) - .on("hidden.bs.modal", function() { + .on("hidden.bs.modal", function () { ok(!$('#modal-test').is(":visible"), 'modal hidden') div.remove() start() @@ -110,7 +110,7 @@ $(function () { ok($('#modal-test').length, 'modal inserted into dom') div.find('.close').click() }) - .on("hidden.bs.modal", function() { + .on("hidden.bs.modal", function () { ok(!$('#modal-test').is(":visible"), 'modal hidden') div.remove() start() @@ -127,7 +127,7 @@ $(function () { ok($('#modal-test').is(":visible"), 'modal visible') div.modal("hide") }) - .on("hidden.bs.modal", function() { + .on("hidden.bs.modal", function () { ok(!$('#modal-test').is(":visible"), 'modal hidden') div.remove() start() @@ -146,7 +146,7 @@ $(function () { ok($('#modal-test').is(":visible"), 'modal visible') $('#modal-test').click() }) - .bind("hidden.bs.modal", function() { + .bind("hidden.bs.modal", function () { ok(!$('#modal-test').is(":visible"), 'modal hidden') div.remove() start() @@ -164,7 +164,7 @@ $(function () { triggered = 0 $('#modal-test').click() }) - .one("hidden.bs.modal", function() { + .one("hidden.bs.modal", function () { div.modal("show") }) .bind("hide.bs.modal", function () { @@ -184,7 +184,7 @@ $(function () { $('#close').click() ok(!$('#modal-test').is(":visible"), 'modal hidden') }) - .one("hidden.bs.modal", function() { + .one("hidden.bs.modal", function () { div.one('hidden.bs.modal', function () { start() }).modal("show") diff --git a/js/tests/unit/phantom.js b/js/tests/unit/phantom.js index c584c5a35..cf9da2537 100644 --- a/js/tests/unit/phantom.js +++ b/js/tests/unit/phantom.js @@ -22,7 +22,7 @@ } // These methods connect QUnit to PhantomJS. - QUnit.log = function(obj) { + QUnit.log = function (obj) { // What is this I don’t even if (obj.message === '[object Object], undefined:undefined') { return } // Parse some stuff before sending it. @@ -32,15 +32,15 @@ sendMessage('qunit.log', obj.result, actual, expected, obj.message, obj.source) } - QUnit.testStart = function(obj) { + QUnit.testStart = function (obj) { sendMessage('qunit.testStart', obj.name) } - QUnit.testDone = function(obj) { + QUnit.testDone = function (obj) { sendMessage('qunit.testDone', obj.name, obj.failed, obj.passed, obj.total) } - QUnit.moduleStart = function(obj) { + QUnit.moduleStart = function (obj) { sendMessage('qunit.moduleStart', obj.name) } diff --git a/js/tests/unit/popover.js b/js/tests/unit/popover.js index c9f7d63a7..a57c787b8 100644 --- a/js/tests/unit/popover.js +++ b/js/tests/unit/popover.js @@ -97,7 +97,7 @@ $(function () { $('#qunit-fixture').empty() }) - test("should respect custom classes", function() { + test("should respect custom classes", function () { $.support.transition = false var popover = $('@fat') .appendTo('#qunit-fixture') @@ -118,7 +118,7 @@ $(function () { }) test("should destroy popover", function () { - var popover = $('
').popover({trigger: 'hover'}).on('click.foo', function(){}) + var popover = $('
').popover({trigger: 'hover'}).on('click.foo', function (){}) ok(popover.data('bs.popover'), 'popover has data') ok($._data(popover[0], 'events').mouseover && $._data(popover[0], 'events').mouseout, 'popover has hover event') ok($._data(popover[0], 'events').click[0].namespace == 'foo', 'popover has extra click.foo event') diff --git a/js/tests/unit/tab.js b/js/tests/unit/tab.js index 0db7cdb5b..18aab7bd7 100644 --- a/js/tests/unit/tab.js +++ b/js/tests/unit/tab.js @@ -76,9 +76,9 @@ $(function () { + '' $(dropHTML).find('ul>li:first a').tab('show').end() - .find('ul>li:last a').on('show', function(event){ + .find('ul>li:last a').on('show', function (event){ equal(event.relatedTarget.hash, "#1-1") - }).on('shown', function(event){ + }).on('shown', function (event){ equal(event.relatedTarget.hash, "#1-1") }).tab('show') }) diff --git a/js/tests/unit/tooltip.js b/js/tests/unit/tooltip.js index dc3ddd377..f589f3dea 100644 --- a/js/tests/unit/tooltip.js +++ b/js/tests/unit/tooltip.js @@ -69,7 +69,7 @@ $(function () { test("should fire show event", function () { stop() var tooltip = $('
') - .on("show.bs.tooltip", function() { + .on("show.bs.tooltip", function () { ok(true, "show was called") start() }) @@ -79,7 +79,7 @@ $(function () { test("should fire shown event", function () { stop() var tooltip = $('
') - .on("shown.bs.tooltip", function() { + .on("shown.bs.tooltip", function () { ok(true, "shown was called") start() }) @@ -89,12 +89,12 @@ $(function () { test("should not fire shown event when default prevented", function () { stop() var tooltip = $('
') - .on("show.bs.tooltip", function(e) { + .on("show.bs.tooltip", function (e) { e.preventDefault() ok(true, "show was called") start() }) - .on("shown.bs.tooltip", function() { + .on("shown.bs.tooltip", function () { ok(false, "shown was called") }) .tooltip('show') @@ -103,10 +103,10 @@ $(function () { test("should fire hide event", function () { stop() var tooltip = $('
') - .on("shown.bs.tooltip", function() { + .on("shown.bs.tooltip", function () { $(this).tooltip('hide') }) - .on("hide.bs.tooltip", function() { + .on("hide.bs.tooltip", function () { ok(true, "hide was called") start() }) @@ -116,10 +116,10 @@ $(function () { test("should fire hidden event", function () { stop() var tooltip = $('
') - .on("shown.bs.tooltip", function() { + .on("shown.bs.tooltip", function () { $(this).tooltip('hide') }) - .on("hidden.bs.tooltip", function() { + .on("hidden.bs.tooltip", function () { ok(true, "hidden was called") start() }) @@ -129,15 +129,15 @@ $(function () { test("should not fire hidden event when default prevented", function () { stop() var tooltip = $('
') - .on("shown.bs.tooltip", function() { + .on("shown.bs.tooltip", function () { $(this).tooltip('hide') }) - .on("hide.bs.tooltip", function(e) { + .on("hide.bs.tooltip", function (e) { e.preventDefault() ok(true, "hide was called") start() }) - .on("hidden.bs.tooltip", function() { + .on("hidden.bs.tooltip", function () { ok(false, "hidden was called") }) .tooltip('show') @@ -258,7 +258,7 @@ $(function () { }) test("should destroy tooltip", function () { - var tooltip = $('
').tooltip().on('click.foo', function(){}) + var tooltip = $('
').tooltip().on('click.foo', function (){}) ok(tooltip.data('bs.tooltip'), 'tooltip has data') ok($._data(tooltip[0], 'events').mouseover && $._data(tooltip[0], 'events').mouseout, 'tooltip has hover event') ok($._data(tooltip[0], 'events').click[0].namespace == 'foo', 'tooltip has extra click.foo event') @@ -297,7 +297,7 @@ $(function () { tooltip.tooltip('hide') }) - test("should place tooltip inside window", function(){ + test("should place tooltip inside window", function (){ var container = $("
").appendTo("body") .css({position: "absolute", width: 200, height: 200, bottom: 0, left: 0}) , tooltip = $("Hover me") @@ -308,7 +308,7 @@ $(function () { stop() - setTimeout(function(){ + setTimeout(function (){ ok($(".tooltip").offset().left >= 0) start() @@ -316,7 +316,7 @@ $(function () { }, 100) }) - test("should place tooltip on top of element", function(){ + test("should place tooltip on top of element", function (){ var container = $("
").appendTo("body") .css({position: "absolute", bottom: 0, left: 0, textAlign: "right", width: 300, height: 300}) , p = $("

").appendTo(container) @@ -328,7 +328,7 @@ $(function () { stop() - setTimeout(function(){ + setTimeout(function (){ var tooltip = container.find(".tooltip") start() @@ -337,7 +337,7 @@ $(function () { }, 100) }) - test("should add position class before positioning so that position-specific styles are taken into account", function(){ + test("should add position class before positioning so that position-specific styles are taken into account", function (){ $("head").append('') var container = $("

").appendTo("body") -- cgit v1.2.3 From 5e2ef69e1cc0ee62dfe1206f25030d1f89d9e50f Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Fri, 6 Dec 2013 12:23:08 +0200 Subject: Use a space before functions' bracket consistently. --- js/tests/unit/popover.js | 2 +- js/tests/unit/tab.js | 4 ++-- js/tests/unit/tooltip.js | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'js/tests/unit') diff --git a/js/tests/unit/popover.js b/js/tests/unit/popover.js index a57c787b8..2a11e0fdf 100644 --- a/js/tests/unit/popover.js +++ b/js/tests/unit/popover.js @@ -118,7 +118,7 @@ $(function () { }) test("should destroy popover", function () { - var popover = $('
').popover({trigger: 'hover'}).on('click.foo', function (){}) + var popover = $('
').popover({trigger: 'hover'}).on('click.foo', function () {}) ok(popover.data('bs.popover'), 'popover has data') ok($._data(popover[0], 'events').mouseover && $._data(popover[0], 'events').mouseout, 'popover has hover event') ok($._data(popover[0], 'events').click[0].namespace == 'foo', 'popover has extra click.foo event') diff --git a/js/tests/unit/tab.js b/js/tests/unit/tab.js index 18aab7bd7..812262812 100644 --- a/js/tests/unit/tab.js +++ b/js/tests/unit/tab.js @@ -76,9 +76,9 @@ $(function () { + '' $(dropHTML).find('ul>li:first a').tab('show').end() - .find('ul>li:last a').on('show', function (event){ + .find('ul>li:last a').on('show', function (event) { equal(event.relatedTarget.hash, "#1-1") - }).on('shown', function (event){ + }).on('shown', function (event) { equal(event.relatedTarget.hash, "#1-1") }).tab('show') }) diff --git a/js/tests/unit/tooltip.js b/js/tests/unit/tooltip.js index f589f3dea..2139dc811 100644 --- a/js/tests/unit/tooltip.js +++ b/js/tests/unit/tooltip.js @@ -258,7 +258,7 @@ $(function () { }) test("should destroy tooltip", function () { - var tooltip = $('
').tooltip().on('click.foo', function (){}) + var tooltip = $('
').tooltip().on('click.foo', function () {}) ok(tooltip.data('bs.tooltip'), 'tooltip has data') ok($._data(tooltip[0], 'events').mouseover && $._data(tooltip[0], 'events').mouseout, 'tooltip has hover event') ok($._data(tooltip[0], 'events').click[0].namespace == 'foo', 'tooltip has extra click.foo event') @@ -297,7 +297,7 @@ $(function () { tooltip.tooltip('hide') }) - test("should place tooltip inside window", function (){ + test("should place tooltip inside window", function () { var container = $("
").appendTo("body") .css({position: "absolute", width: 200, height: 200, bottom: 0, left: 0}) , tooltip = $("Hover me") @@ -308,7 +308,7 @@ $(function () { stop() - setTimeout(function (){ + setTimeout(function () { ok($(".tooltip").offset().left >= 0) start() @@ -316,7 +316,7 @@ $(function () { }, 100) }) - test("should place tooltip on top of element", function (){ + test("should place tooltip on top of element", function () { var container = $("
").appendTo("body") .css({position: "absolute", bottom: 0, left: 0, textAlign: "right", width: 300, height: 300}) , p = $("

").appendTo(container) @@ -328,7 +328,7 @@ $(function () { stop() - setTimeout(function (){ + setTimeout(function () { var tooltip = container.find(".tooltip") start() @@ -337,7 +337,7 @@ $(function () { }, 100) }) - test("should add position class before positioning so that position-specific styles are taken into account", function (){ + test("should add position class before positioning so that position-specific styles are taken into account", function () { $("head").append('') var container = $("

").appendTo("body") -- cgit v1.2.3 From 351f86e1db6bbb5f37e67323094fc08f4aeceecd Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Fri, 6 Dec 2013 16:51:59 -0800 Subject: fix some JS to pass jscs --- js/tests/unit/scrollspy.js | 2 +- js/tests/unit/tooltip.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'js/tests/unit') diff --git a/js/tests/unit/scrollspy.js b/js/tests/unit/scrollspy.js index 06219a1c8..1b546a579 100644 --- a/js/tests/unit/scrollspy.js +++ b/js/tests/unit/scrollspy.js @@ -19,7 +19,7 @@ $(function () { test("should switch active class on scroll", function () { var sectionHTML = '
' , $section = $(sectionHTML).append('#qunit-fixture') - , topbarHTML ='
' + , topbarHTML = '
' + '
' + '
' + '

Bootstrap

' diff --git a/js/tests/unit/tooltip.js b/js/tests/unit/tooltip.js index 2139dc811..cc559ccb6 100644 --- a/js/tests/unit/tooltip.js +++ b/js/tests/unit/tooltip.js @@ -290,7 +290,7 @@ $(function () { test("should place tooltips inside the body", function () { var tooltip = $('') .appendTo('#qunit-fixture') - .tooltip({container:'body'}) + .tooltip({container: 'body'}) .tooltip('show') ok($("body > .tooltip").length, 'inside the body') ok(!$("#qunit-fixture > .tooltip").length, 'not found in parent') @@ -301,7 +301,7 @@ $(function () { var container = $("
").appendTo("body") .css({position: "absolute", width: 200, height: 200, bottom: 0, left: 0}) , tooltip = $("Hover me") - .css({position: "absolute", top:0, left: 0}) + .css({position: "absolute", top: 0, left: 0}) .appendTo(container) .tooltip({placement: "top", animate: false}) .tooltip("show") @@ -347,7 +347,7 @@ $(function () { .tooltip('show') , tooltip = container.find(".tooltip") - ok( Math.round(target.offset().top + target[0].offsetHeight/2 - tooltip[0].offsetHeight/2) === Math.round(tooltip.offset().top) ) + ok( Math.round(target.offset().top + (target[0].offsetHeight / 2) - (tooltip[0].offsetHeight / 2)) === Math.round(tooltip.offset().top) ) target.tooltip('hide') }) -- cgit v1.2.3 From eca8ff380388c1187bc2c86e0ae7fa80aa33111e Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Wed, 18 Sep 2013 19:50:02 +0300 Subject: Use single quotes consistently. --- js/tests/unit/affix.js | 10 +-- js/tests/unit/alert.js | 14 ++-- js/tests/unit/button.js | 20 ++--- js/tests/unit/carousel.js | 34 ++++---- js/tests/unit/collapse.js | 24 +++--- js/tests/unit/dropdown.js | 34 ++++---- js/tests/unit/modal.js | 152 +++++++++++++++++----------------- js/tests/unit/phantom.js | 16 ++-- js/tests/unit/popover.js | 28 +++---- js/tests/unit/scrollspy.js | 10 +-- js/tests/unit/tab.js | 32 +++---- js/tests/unit/tooltip.js | 198 ++++++++++++++++++++++---------------------- js/tests/unit/transition.js | 6 +- 13 files changed, 289 insertions(+), 289 deletions(-) (limited to 'js/tests/unit') diff --git a/js/tests/unit/affix.js b/js/tests/unit/affix.js index b74bc51e4..6085a141e 100644 --- a/js/tests/unit/affix.js +++ b/js/tests/unit/affix.js @@ -1,22 +1,22 @@ $(function () { - module("affix") + module('affix') - test("should provide no conflict", function () { + 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 () { + test('should be defined on jquery object', function () { ok($(document.body).affix, 'affix method is defined') }) - test("should return element", function () { + test('should return element', function () { ok($(document.body).affix()[0] == document.body, 'document.body returned') }) - test("should exit early if element is not visible", function () { + test('should exit early if element is not visible', function () { var $affix = $('
').affix() $affix.data('bs.affix').checkPosition() ok(!$affix.hasClass('affix'), 'affix class was not added') diff --git a/js/tests/unit/alert.js b/js/tests/unit/alert.js index 98b10059e..5e39bbab6 100644 --- a/js/tests/unit/alert.js +++ b/js/tests/unit/alert.js @@ -1,22 +1,22 @@ $(function () { - module("alert") + module('alert') - test("should provide no conflict", function () { + 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 () { + test('should be defined on jquery object', function () { ok($(document.body).alert, 'alert method is defined') }) - test("should return element", function () { + test('should return element', function () { ok($(document.body).alert()[0] == document.body, 'document.body returned') }) - test("should fade element out on clicking .close", function () { + test('should fade element out on clicking .close', function () { var alertHTML = '
' + '×' + '

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

' @@ -28,7 +28,7 @@ $(function () { ok(!alert.hasClass('in'), 'remove .in class on .close click') }) - test("should remove element when clicking .close", function () { + test('should remove element when clicking .close', function () { $.support.transition = false var alertHTML = '
' @@ -44,7 +44,7 @@ $(function () { ok(!$('#qunit-fixture').find('.alert-message').length, 'element removed from dom') }) - test("should not fire closed when close is prevented", function () { + test('should not fire closed when close is prevented', function () { $.support.transition = false stop(); $('
') diff --git a/js/tests/unit/button.js b/js/tests/unit/button.js index 115edefaf..45397aeff 100644 --- a/js/tests/unit/button.js +++ b/js/tests/unit/button.js @@ -1,22 +1,22 @@ $(function () { - module("button") + module('button') - test("should provide no conflict", function () { + 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 () { + test('should be defined on jquery object', function () { ok($(document.body).button, 'button method is defined') }) - test("should return element", function () { + test('should return element', function () { ok($(document.body).button()[0] == document.body, 'document.body returned') }) - test("should return set state to loading", function () { + test('should return set state to loading', function () { var btn = $('') equal(btn.html(), 'mdo', 'btn text equals mdo') btn.button('loading') @@ -29,7 +29,7 @@ $(function () { }, 0) }) - test("should return reset state", function () { + test('should return reset state', function () { var btn = $('') equal(btn.html(), 'mdo', 'btn text equals mdo') btn.button('loading') @@ -51,14 +51,14 @@ $(function () { }) - test("should toggle active", function () { + test('should toggle active', function () { var btn = $('') ok(!btn.hasClass('active'), 'btn does not have active class') btn.button('toggle') ok(btn.hasClass('active'), 'btn has class active') }) - test("should toggle active when btn children are clicked", function () { + test('should toggle active when btn children are clicked', function () { var btn = $('') , inner = $('') btn @@ -69,7 +69,7 @@ $(function () { ok(btn.hasClass('active'), 'btn has class active') }) - test("should toggle active when btn children are clicked within btn-group", function () { + test('should toggle active when btn children are clicked within btn-group', function () { var btngroup = $('
') , btn = $('') , inner = $('') @@ -81,7 +81,7 @@ $(function () { ok(btn.hasClass('active'), 'btn has class active') }) - test("should check for closest matching toggle", function () { + test('should check for closest matching toggle', function () { var group = '
' + '