mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-08 17:22:31 +03:00
v4 improve coverage (#25945)
* Improve code coverage for our Button plugin * improve coverage for our Alert plugin * test tooltip update method * test update and dispose for dropdown * increase code coverage requirements
This commit is contained in:
@@ -80,4 +80,43 @@ $(function () {
|
||||
})
|
||||
.bootstrapAlert('close')
|
||||
})
|
||||
|
||||
QUnit.test('close should use internal _element if no element provided', function (assert) {
|
||||
assert.expect(1)
|
||||
|
||||
var done = assert.async()
|
||||
var $el = $('<div/>')
|
||||
var $alert = $el.bootstrapAlert()
|
||||
var alertInstance = $alert.data('bs.alert')
|
||||
|
||||
$alert.one('closed.bs.alert', function () {
|
||||
assert.ok('alert closed')
|
||||
done()
|
||||
})
|
||||
|
||||
alertInstance.close()
|
||||
})
|
||||
|
||||
QUnit.test('dispose should remove data and the element', function (assert) {
|
||||
assert.expect(2)
|
||||
|
||||
var $el = $('<div/>')
|
||||
var $alert = $el.bootstrapAlert()
|
||||
|
||||
assert.ok(typeof $alert.data('bs.alert') !== 'undefined')
|
||||
|
||||
$alert.data('bs.alert').dispose()
|
||||
|
||||
assert.ok(typeof $alert.data('bs.button') === 'undefined')
|
||||
})
|
||||
|
||||
QUnit.test('should return alert version', function (assert) {
|
||||
assert.expect(1)
|
||||
|
||||
if (typeof Alert !== 'undefined') {
|
||||
assert.ok(typeof Alert.VERSION === 'string')
|
||||
} else {
|
||||
assert.notOk()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user