diff options
| author | Johann-S <[email protected]> | 2017-08-21 09:11:37 +0200 |
|---|---|---|
| committer | XhmikosR <[email protected]> | 2019-02-20 22:05:45 +0200 |
| commit | 0b16c8c6d9a9690d537bd08eac8a8292ebf938cd (patch) | |
| tree | cf06827946db78c07a40d797a01fc5fd7a11e18d /js/tests/unit/alert.js | |
| parent | 8d34bc136b54f4605595f228253463c90a3c5c97 (diff) | |
| download | bootstrap-0b16c8c6d9a9690d537bd08eac8a8292ebf938cd.tar.xz bootstrap-0b16c8c6d9a9690d537bd08eac8a8292ebf938cd.zip | |
alert without jquery
Diffstat (limited to 'js/tests/unit/alert.js')
| -rw-r--r-- | js/tests/unit/alert.js | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/js/tests/unit/alert.js b/js/tests/unit/alert.js index 65a8f9e76..32fcc6cea 100644 --- a/js/tests/unit/alert.js +++ b/js/tests/unit/alert.js @@ -70,16 +70,19 @@ $(function () { QUnit.test('should not fire closed when close is prevented', function (assert) { assert.expect(1) var done = assert.async() - $('<div class="alert"/>') - .on('close.bs.alert', function (e) { - e.preventDefault() - assert.ok(true, 'close event fired') - done() - }) - .on('closed.bs.alert', function () { - assert.ok(false, 'closed event fired') - }) - .bootstrapAlert('close') + var $alert = $('<div class="alert"/>') + $alert.appendTo('#qunit-fixture') + + EventHandler.on($alert[0], 'close.bs.alert', function (e) { + e.preventDefault() + assert.ok(true, 'close event fired') + done() + }) + EventHandler.on($alert[0], 'closed.bs.alert', function () { + assert.ok(false, 'closed event fired') + }) + + $alert.bootstrapAlert('close') }) QUnit.test('close should use internal _element if no element provided', function (assert) { |
