From: Pierre Vanduynslager Date: Tue, 21 Mar 2017 17:21:00 +0000 (-0400) Subject: Always append element to fixture in Scrollspy unit tests (#22234) X-Git-Tag: v4.0.0-beta~147^2~118 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78fc4d23fcefe31397444b75f43728c38e13c590;p=thirdparty%2Fbootstrap.git Always append element to fixture in Scrollspy unit tests (#22234) --- diff --git a/js/tests/unit/scrollspy.js b/js/tests/unit/scrollspy.js index 877ec67a2a..36c4c40760 100644 --- a/js/tests/unit/scrollspy.js +++ b/js/tests/unit/scrollspy.js @@ -26,7 +26,7 @@ $(function () { QUnit.test('should throw explicit error on undefined method', function (assert) { assert.expect(1) - var $el = $('
') + var $el = $('
').appendTo('#qunit-fixture') $el.bootstrapScrollspy() try { $el.bootstrapScrollspy('noMethod') @@ -38,7 +38,7 @@ $(function () { QUnit.test('should return jquery collection containing the element', function (assert) { assert.expect(2) - var $el = $('
') + var $el = $('
').appendTo('#qunit-fixture') var $scrollspy = $el.bootstrapScrollspy() assert.ok($scrollspy instanceof $, 'returns jquery collection') assert.strictEqual($scrollspy[0], $el[0], 'collection contains element')