1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-12 08:34:08 +02:00

Merge pull request #16147 from Johann-S/event_inserted

Fixes #16124.
This commit is contained in:
Chris Rebert
2015-04-21 21:40:14 -07:00
5 changed files with 40 additions and 0 deletions

View File

@@ -259,4 +259,21 @@ $(function () {
assert.strictEqual($popover.data('bs.popover'), undefined, 'should not initialize the popover')
})
QUnit.test('should fire inserted event', function (assert) {
assert.expect(2)
var done = assert.async()
$('<a href="#">@Johann-S</a>')
.appendTo('#qunit-fixture')
.on('inserted.bs.popover', function () {
assert.notEqual($('.popover').length, 0, 'popover was inserted')
assert.ok(true, 'inserted event fired')
done()
})
.bootstrapPopover({
title: 'Test',
content: 'Test'
})
.bootstrapPopover('show')
})
})

View File

@@ -139,6 +139,20 @@ $(function () {
.bootstrapTooltip('show')
})
QUnit.test('should fire inserted event', function (assert) {
assert.expect(2)
var done = assert.async()
$('<div title="tooltip title"/>')
.appendTo('#qunit-fixture')
.on('inserted.bs.tooltip', function () {
assert.notEqual($('.tooltip').length, 0, 'tooltip was inserted')
assert.ok(true, 'inserted event fired')
done()
})
.bootstrapTooltip('show')
})
QUnit.test('should fire shown event', function (assert) {
assert.expect(1)
var done = assert.async()