2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-08 17:22:31 +03:00

fix(data): do not use data object in our unit tests

This commit is contained in:
Johann-S
2018-06-07 21:43:04 +02:00
committed by XhmikosR
parent 7eddee286e
commit 2b78078779
21 changed files with 190 additions and 44 deletions
+4 -2
View File
@@ -1,6 +1,8 @@
$(function () {
'use strict'
var ScrollSpy = typeof window.bootstrap !== 'undefined' ? window.bootstrap.ScrollSpy : window.ScrollSpy
QUnit.module('scrollspy plugin')
QUnit.test('should be defined on jquery object', function (assert) {
@@ -667,7 +669,7 @@ $(function () {
}
var $target = $('#div-' + type + 'm-2')
var scrollspy = Data.getData($content[0], 'bs.scrollspy')
var scrollspy = ScrollSpy._getInstance($content[0])
assert.ok(scrollspy._offsets[1] === $target.offset().top, 'offset method with ' + type + ' option')
assert.ok(scrollspy._offsets[1] !== $target.position().top, 'position method with ' + type + ' option')
@@ -714,7 +716,7 @@ $(function () {
}
var $target = $('#div-' + type + 'm-2')
var scrollspy = Data.getData($content[0], 'bs.scrollspy')
var scrollspy = ScrollSpy._getInstance($content[0])
assert.ok(scrollspy._offsets[1] !== $target.offset().top, 'offset method with ' + type + ' option')
assert.ok(scrollspy._offsets[1] === $target.position().top, 'position method with ' + type + ' option')