0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-12-01 13:24:25 +01:00

tests: add tests for plugins version. (#28366)

This commit is contained in:
XhmikosR 2019-02-27 13:20:25 +02:00 committed by GitHub
parent bc60a22a18
commit 9cbd041f6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 42 additions and 16 deletions

View File

@ -116,13 +116,8 @@ $(function () {
assert.ok(Alert._getInstance($alert[0]) === null)
})
QUnit.test('should return alert version', function (assert) {
QUnit.test('should return the version', function (assert) {
assert.expect(1)
if (typeof Alert !== 'undefined') {
assert.ok(typeof Alert.VERSION === 'string')
} else {
assert.notOk()
}
assert.strictEqual(typeof Alert.VERSION, 'string')
})
})

View File

@ -218,13 +218,8 @@ $(function () {
assert.ok(Button._getInstance($button[0]) === null)
})
QUnit.test('should return button version', function (assert) {
QUnit.test('should return the version', function (assert) {
assert.expect(1)
if (typeof Button !== 'undefined') {
assert.ok(typeof Button.VERSION === 'string')
} else {
assert.notOk()
}
assert.strictEqual(typeof Button.VERSION, 'string')
})
})

View File

@ -46,9 +46,8 @@ $(function () {
assert.strictEqual(typeof $.fn.carousel, 'undefined', 'carousel was set back to undefined (orig value)')
})
QUnit.test('should return version', function (assert) {
QUnit.test('should return the version', function (assert) {
assert.expect(1)
assert.strictEqual(typeof Carousel.VERSION, 'string')
})

View File

@ -897,4 +897,9 @@ $(function () {
$collapse2.bootstrapCollapse('toggle')
})
QUnit.test('should return the version', function (assert) {
assert.expect(1)
assert.strictEqual(typeof Collapse.VERSION, 'string')
})
})

View File

@ -1423,4 +1423,9 @@ $(function () {
assert.strictEqual(offset.offset, myOffset)
assert.ok(typeof offset.fn === 'undefined')
})
QUnit.test('should return the version', function (assert) {
assert.expect(1)
assert.strictEqual(typeof Dropdown.VERSION, 'string')
})
})

View File

@ -796,4 +796,9 @@ $(function () {
})
.bootstrapModal('show')
})
QUnit.test('should return the version', function (assert) {
assert.expect(1)
assert.strictEqual(typeof Modal.VERSION, 'string')
})
})

View File

@ -466,4 +466,9 @@ $(function () {
$popover[0].click()
})
QUnit.test('should return the version', function (assert) {
assert.expect(1)
assert.strictEqual(typeof Popover.VERSION, 'string')
})
})

View File

@ -727,4 +727,9 @@ $(function () {
testOffsetMethod('js')
testOffsetMethod('data')
})
QUnit.test('should return the version', function (assert) {
assert.expect(1)
assert.strictEqual(typeof ScrollSpy.VERSION, 'string')
})
})

View File

@ -1,6 +1,8 @@
$(function () {
'use strict'
var Tab = typeof window.bootstrap !== 'undefined' ? window.bootstrap.Tab : window.Tab
QUnit.module('tabs plugin')
QUnit.test('should be defined on jquery object', function (assert) {
@ -520,4 +522,9 @@ $(function () {
$('#secondNav')[0].click()
})
QUnit.test('should return the version', function (assert) {
assert.expect(1)
assert.strictEqual(typeof Tab.VERSION, 'string')
})
})

View File

@ -1249,4 +1249,9 @@ $(function () {
assert.strictEqual(tooltip.config.sanitize, true)
})
QUnit.test('should return the version', function (assert) {
assert.expect(1)
assert.strictEqual(typeof Tooltip.VERSION, 'string')
})
})