mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-30 22:52:24 +01:00
Always append element to fixture in Scrollspy unit tests (#22234)
This commit is contained in:
parent
cab6f7d16c
commit
78fc4d23fc
@ -26,7 +26,7 @@ $(function () {
|
|||||||
|
|
||||||
QUnit.test('should throw explicit error on undefined method', function (assert) {
|
QUnit.test('should throw explicit error on undefined method', function (assert) {
|
||||||
assert.expect(1)
|
assert.expect(1)
|
||||||
var $el = $('<div/>')
|
var $el = $('<div/>').appendTo('#qunit-fixture')
|
||||||
$el.bootstrapScrollspy()
|
$el.bootstrapScrollspy()
|
||||||
try {
|
try {
|
||||||
$el.bootstrapScrollspy('noMethod')
|
$el.bootstrapScrollspy('noMethod')
|
||||||
@ -38,7 +38,7 @@ $(function () {
|
|||||||
|
|
||||||
QUnit.test('should return jquery collection containing the element', function (assert) {
|
QUnit.test('should return jquery collection containing the element', function (assert) {
|
||||||
assert.expect(2)
|
assert.expect(2)
|
||||||
var $el = $('<div/>')
|
var $el = $('<div/>').appendTo('#qunit-fixture')
|
||||||
var $scrollspy = $el.bootstrapScrollspy()
|
var $scrollspy = $el.bootstrapScrollspy()
|
||||||
assert.ok($scrollspy instanceof $, 'returns jquery collection')
|
assert.ok($scrollspy instanceof $, 'returns jquery collection')
|
||||||
assert.strictEqual($scrollspy[0], $el[0], 'collection contains element')
|
assert.strictEqual($scrollspy[0], $el[0], 'collection contains element')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user