]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Always append element to fixture in Scrollspy unit tests (#22234)
authorPierre Vanduynslager <pierre.denis.vanduynslager@gmail.com>
Tue, 21 Mar 2017 17:21:00 +0000 (13:21 -0400)
committerMark Otto <markd.otto@gmail.com>
Tue, 21 Mar 2017 17:21:00 +0000 (10:21 -0700)
js/tests/unit/scrollspy.js

index 877ec67a2abf3f8e5e7865048205df4a5d9b0128..36c4c40760c82d86f6720f3f29ff707b9886aaf4 100644 (file)
@@ -26,7 +26,7 @@ $(function () {
 
   QUnit.test('should throw explicit error on undefined method', function (assert) {
     assert.expect(1)
-    var $el = $('<div/>')
+    var $el = $('<div/>').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 = $('<div/>')
+    var $el = $('<div/>').appendTo('#qunit-fixture')
     var $scrollspy = $el.bootstrapScrollspy()
     assert.ok($scrollspy instanceof $, 'returns jquery collection')
     assert.strictEqual($scrollspy[0], $el[0], 'collection contains element')